]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Merge r4097 from trunk.
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Mon, 9 Jan 2012 04:30:31 +0000 (23:30 -0500)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Mon, 9 Jan 2012 04:30:31 +0000 (23:30 -0500)
SVN-Revision: 4100

libarchive/test/test_sparse_basic.c

index 0656f2ff732322750b357cdfb89fb87d9c22eb94..52d76c6013df74441ef82381764820d53ac9d3b3 100644 (file)
@@ -183,14 +183,16 @@ is_sparse_supported(const char *path)
        d = strtol(p, &e, 10);
        if (d < 2 || *e != '.')
                return (0);
-       p = e + 1;
-       d = strtol(p, &e, 10);
-       if (d < 6 || *e != '.')
-               return (0);
-       p = e + 1;
-       d = strtol(p, NULL, 10);
-       if (d < 28)
-               return (0);
+       if (d == 2) {
+               p = e + 1;
+               d = strtol(p, &e, 10);
+               if (d < 6 || *e != '.')
+                       return (0);
+               p = e + 1;
+               d = strtol(p, NULL, 10);
+               if (d < 28)
+                       return (0);
+       }
        create_sparse_file(testfile, sparse_file);
        fd = open(testfile,  O_RDWR);
        if (fd < 0)