]> sourceware.org Git - newlib-cygwin.git/commitdiff
* dump_setup.cc (find_tar_ext): Generalize search for .tar extension, avoiding
authorChristopher Faylor <me@cgf.cx>
Mon, 16 Sep 2013 17:01:58 +0000 (17:01 +0000)
committerChristopher Faylor <me@cgf.cx>
Mon, 16 Sep 2013 17:01:58 +0000 (17:01 +0000)
looking for specific compression types.

winsup/utils/ChangeLog
winsup/utils/dump_setup.cc

index 743913077f493b179985d490ff1f130f24a5ec6c..69ff8e7bfd7f2da73037ee35a7288d5e91a81c55 100644 (file)
@@ -1,3 +1,8 @@
+2013-09-16  Christopher Faylor  <me.cygwin2013@cgf.cx>
+
+       * dump_setup.cc (find_tar_ext): Generalize search for .tar extension,
+       avoiding looking for specific compression types.
+
 2013-08-23  Christopher Faylor  <me.cygwin2013@cgf.cx>
 
        * cygcheck.cc (package_grep): Accommodate arch-specific package layout.
index ae5fc0446cc97c28912a853048488de96ad6076e..002c91d9f644cc781cb4f4f088dd891a2fb47e6c 100644 (file)
@@ -41,18 +41,13 @@ typedef struct
 static int
 find_tar_ext (const char *path)
 {
-  char *p = strchr (path, '\0') - 7;
+  char *p = strchr (path, '\0') - 9;
   if (p <= path)
     return 0;
-  if (*p == '.')
-    {
-      if (strcmp (p, ".tar.gz") != 0)
-       return 0;
-    }
-  else if (--p <= path || strcmp (p, ".tar.bz2") != 0)
+  if ((p = strstr (p, ".tar")) != NULL)
+    return p - path;
+  else
     return 0;
-
-  return p - path;
 }
 
 static char *
This page took 0.035752 seconds and 5 git commands to generate.