summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Satiro <raysatiro@yahoo.com>2021-03-17 03:07:15 -0400
committerJay Satiro <raysatiro@yahoo.com>2021-03-17 03:07:15 -0400
commitfa9b3db12470eb2df6a1cd6c61c74bc32afd138d (patch)
tree1f43618cee27c0d492c07016b1071c02cbe90d52
parent4f817152c10399d14ef1f80a0fe49b47c3a5502a (diff)
downloadcurl-fa9b3db12470eb2df6a1cd6c61c74bc32afd138d.tar.gz
more
-rw-r--r--src/tool_homedir.c8
-rw-r--r--src/tool_parsecfg.c9
2 files changed, 16 insertions, 1 deletions
diff --git a/src/tool_homedir.c b/src/tool_homedir.c
index 632bdcc4f..cb1e01a8f 100644
--- a/src/tool_homedir.c
+++ b/src/tool_homedir.c
@@ -77,16 +77,24 @@ char *homedir(const char *fname)
{
char *home;
+ fprintf(stderr, "DEBUG: homedir(\"%s\")\n", fname ? fname : "(null)");
+
home = GetEnv("CURL_HOME");
+ fprintf(stderr, "DEBUG: CURL_HOME: %s\n", home ? home : "(null)");
if(home)
return home;
if(fname) {
home = GetEnv("XDG_CONFIG_HOME");
+ fprintf(stderr, "DEBUG: XDG_CONFIG_HOME: %s\n", home ? home : "(null)");
if(home) {
char *c = curl_maprintf("%s" DIR_CHAR "%s", home, fname);
+ fprintf(stderr, "DEBUG: c: %s\n", c ? c : "(null)");
if(c) {
int fd = open(c, O_RDONLY);
+ fprintf(stderr, "DEBUG: fd: %d\n", fd);
+ if(fd == -1)
+ fprintf(stderr, "DEBUG: errno: %d\n", errno);
curl_free(c);
if(fd >= 0) {
close(fd);
diff --git a/src/tool_parsecfg.c b/src/tool_parsecfg.c
index d26774faf..2ca08fdf5 100644
--- a/src/tool_parsecfg.c
+++ b/src/tool_parsecfg.c
@@ -82,6 +82,9 @@ int parseconfig(const char *filename, struct GlobalConfig *global)
struct OperationConfig *operation = global->last;
char *pathalloc = NULL;
+ fprintf(stderr, "DEBUG: parseconfig \"%s\"\n",
+ filename ? filename : "(null)");
+
if(!filename || !*filename) {
/* NULL or no file name attempts to load .curlrc from the homedir! */
@@ -89,6 +92,8 @@ int parseconfig(const char *filename, struct GlobalConfig *global)
#ifndef WIN32
if(home) {
pathalloc = curl_maprintf("%s%s.curlrc", home, DIR_CHAR);
+ fprintf(stderr, "DEBUG: pathalloc: %s\n",
+ pathalloc ? pathalloc : "(null)");
if(!pathalloc) {
free(home);
return 1; /* out of memory */
@@ -130,8 +135,10 @@ int parseconfig(const char *filename, struct GlobalConfig *global)
}
if(!file && filename) { /* no need to fopen() again */
- if(strcmp(filename, "-"))
+ if(strcmp(filename, "-")) {
file = fopen(filename, FOPEN_READTEXT);
+ fprintf(stderr, "DEBUG: file: %p\n", file);
+ }
else
file = stdin;
}