Make detection of symbolic links more consistent

While fixing the detection of symbolic links on OpenBSD I noticed
inconsistent behaviour:

$ echo hello > hello
$ ln -s hello world
$ zstd hello world
Warning : world is a symbolic link, ignoring
hello                :316.67%   (     6 =>     19 bytes, hello.zst
$ ls *.zst
hello.zst
$ zstd world
world                :316.67%   (     6 =>     19 bytes, world.zst)
$ ls *.zst
hello.zst world.zst
This commit is contained in:
Björn Ketelaars 2019-02-12 00:07:32 +01:00
parent 1e4dc2e5f1
commit 482b84f07b

View File

@ -951,6 +951,8 @@ int main(int argCount, const char* argv[])
filenameTable[fileNamesNb++] = filenameTable[u];
}
}
if (fileNamesNb == 0 && filenameIdx > 0)
CLEAN_RETURN(1);
filenameIdx = fileNamesNb;
}
if (recursive) { /* at this stage, filenameTable is a list of paths, which can contain both files and directories */