]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Fixed https://github.com/facebook/zstd/issues/232
authorPrzemyslaw Skibinski <inikep@gmail.com>
Wed, 25 Jan 2017 12:02:33 +0000 (13:02 +0100)
committerNick Terrell <terrelln@fb.com>
Fri, 27 Jan 2017 18:43:03 +0000 (10:43 -0800)
.travis.yml
programs/fileio.c

index bbd77500102ed262bcd8fee14ff505a6370f2d95..ba9f9965d9d471d996463185980735e0c4dcb76b 100644 (file)
@@ -170,6 +170,6 @@ matrix:
 script:
   - JOB_NUMBER=$(echo $TRAVIS_JOB_NUMBER | sed -e 's:[0-9][0-9]*\.\(.*\):\1:')
   #  dev => normal tests;  other feature branches => short tests (number > 11)
-  - if [ "$TRAVIS_BRANCH" != "master" ] && [ "$TRAVIS_BRANCH" = "dev" ] || [ "$TRAVIS_PULL_REQUEST" = "true" ] || [ $JOB_NUMBER -gt 11 ]; then sh -c "$Cmd"; fi
+  - if [ "$TRAVIS_PULL_REQUEST" = "true" ] || [ $JOB_NUMBER -gt 11 ] || [ "$TRAVIS_BRANCH" = "dev" ] && [ "$TRAVIS_BRANCH" != "master" ]; then sh -c "$Cmd"; fi
   #  master => long tests, as this is the final step towards a Release
   - if [ "$TRAVIS_BRANCH" = "master" ]; then FUZZERTEST=-T10mn sh -c "$Cmd"; fi
index ac7dffb31abdd772cfcc61155f189a7fcdbfd86a..596c922f416e82961b7ccf1a8088478ab2397b55 100644 (file)
@@ -414,6 +414,11 @@ static int FIO_compressFilename_srcFile(cRess_t ress,
         DISPLAYLEVEL(1, "zstd: %s is a directory -- ignored \n", srcFileName);
         return 1;
     }
+    if (!UTIL_doesFileExists(srcFileName)) {
+        DISPLAYLEVEL(1, "zstd: %s is not a regular file -- ignored \n", srcFileName);
+        return 1;
+    }
+
     ress.srcFile = FIO_openSrcFile(srcFileName);
     if (!ress.srcFile) return 1;   /* srcFile could not be opened */
 
@@ -772,6 +777,10 @@ static int FIO_decompressSrcFile(dRess_t ress, const char* dstFileName, const ch
         DISPLAYLEVEL(1, "zstd: %s is a directory -- ignored \n", srcFileName);
         return 1;
     }
+    if (!UTIL_doesFileExists(srcFileName)) {
+        DISPLAYLEVEL(1, "zstd: %s is not a regular file -- ignored \n", srcFileName);
+        return 1;
+    }
 
     srcFile = FIO_openSrcFile(srcFileName);
     if (srcFile==0) return 1;