Loading src/main.c +9 −2 Original line number Diff line number Diff line Loading @@ -832,16 +832,21 @@ static int parseconfig(char *filename, char configbuffer[4096]; char filebuffer[256]; bool usedarg; char *home=NULL; if(!filename || !*filename) { /* NULL or no file name attempts to load .curlrc from the homedir! */ #define CURLRC DOT_CHAR "curlrc" char *home = curl_GetEnv("HOME"); /* portable environment reader */ home = curl_GetEnv("HOME"); /* portable environment reader */ if(!home || (strlen(home)>(sizeof(filebuffer)-strlen(CURLRC)))) if(!home) return CURLE_OK; if(strlen(home)>(sizeof(filebuffer)-strlen(CURLRC))) { free(home); return CURLE_OK; } sprintf(filebuffer, "%s%s%s", home, DIR_CHAR, CURLRC); Loading Loading @@ -909,6 +914,8 @@ static int parseconfig(char *filename, if(file != stdin) fclose(file); } if(home) free(home); return CURLE_OK; } Loading Loading
src/main.c +9 −2 Original line number Diff line number Diff line Loading @@ -832,16 +832,21 @@ static int parseconfig(char *filename, char configbuffer[4096]; char filebuffer[256]; bool usedarg; char *home=NULL; if(!filename || !*filename) { /* NULL or no file name attempts to load .curlrc from the homedir! */ #define CURLRC DOT_CHAR "curlrc" char *home = curl_GetEnv("HOME"); /* portable environment reader */ home = curl_GetEnv("HOME"); /* portable environment reader */ if(!home || (strlen(home)>(sizeof(filebuffer)-strlen(CURLRC)))) if(!home) return CURLE_OK; if(strlen(home)>(sizeof(filebuffer)-strlen(CURLRC))) { free(home); return CURLE_OK; } sprintf(filebuffer, "%s%s%s", home, DIR_CHAR, CURLRC); Loading Loading @@ -909,6 +914,8 @@ static int parseconfig(char *filename, if(file != stdin) fclose(file); } if(home) free(home); return CURLE_OK; } Loading