From df05b2ba7c22b6b45ef4ccc133f6c71d49db65c0 Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Wed, 5 May 2021 18:01:55 -0700 Subject: [PATCH] fix --filelist compatibility with Windows cr+lf line ending --- programs/util.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/programs/util.c b/programs/util.c index ffda7866509..8d190c62c46 100644 --- a/programs/util.c +++ b/programs/util.c @@ -323,9 +323,7 @@ U64 UTIL_getTotalFileSize(const char* const * fileNamesTable, unsigned nbFiles) static size_t readLineFromFile(char* buf, size_t len, FILE* file) { assert(!feof(file)); - /* Work around Cygwin problem when len == 1 it returns NULL. */ - if (len <= 1) return 0; - CONTROL( fgets(buf, (int) len, file) ); + if ( fgets(buf, (int) len, file) == NULL ) return 0; { size_t linelen = strlen(buf); if (strlen(buf)==0) return 0; if (buf[linelen-1] == '\n') linelen--;