diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-09-13 23:16:07 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-09-13 23:16:07 +0200 |
commit | f879725c4b33748bd588c65d626f90d4e08e80c7 (patch) | |
tree | ab8a2d938982b1215703df34303bff94fd1416f0 | |
parent | 2877e66b96a5f6227e1baabc96042ffe8b74cdc8 (diff) | |
download | curl-f879725c4b33748bd588c65d626f90d4e08e80c7.tar.gz |
fixup handle a single line without newline
-rw-r--r-- | src/tool_parsecfg.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tool_parsecfg.c b/src/tool_parsecfg.c index 2b0a01d07..f09180ed4 100644 --- a/src/tool_parsecfg.c +++ b/src/tool_parsecfg.c @@ -356,7 +356,8 @@ static bool my_get_line(FILE *fp, struct curlx_dynbuf *db, /* fgets() returns s on success, and NULL on error or when end of file occurs while no characters have been read. */ if(!fgets(buf, sizeof(buf), fp)) - return FALSE; /* stop reading */ + /* only if there's data in the line, return TRUE */ + return curlx_dyn_len(db) ? TRUE : FALSE; if(curlx_dyn_add(db, buf)) { *error = TRUE; /* error */ return FALSE; /* stop reading */ |