]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Don't glob the file name "-" that means to read from stdin
authorFrederic Marchal <fmarchal@users.sourceforge.net>
Tue, 23 Jun 2015 15:48:12 +0000 (17:48 +0200)
committerFrederic Marchal <fmarchal@users.sourceforge.net>
Tue, 23 Jun 2015 15:48:12 +0000 (17:48 +0200)
The special file name "-" must not be globed as the content will be read
from stdin.

This change fix the error message: No files matching "-"

Thanks to Yakushev Evgeniy for reporting this bug.

filelist.c

index c90e23dfe17579a3ff7a251515ef11d70b69b960..c36b96d3a4db6dae51695b32a05286858b7d15ec 100644 (file)
@@ -440,7 +440,7 @@ const char *FileListIter_Next(struct _FileListIterator *FIter)
                FIter->NextGlob=0;
        }
        Path=FileListIter_NextWithMask(FIter);
-       if (Path!=NULL)
+       if (Path!=NULL && (Path[0]!='-' || Path[1]!='\0'))
        {
                int ErrCode=glob(Path,GLOB_ERR | GLOB_NOSORT,NULL,&FIter->Glob);
                if (ErrCode!=0)