summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2013-09-16 17:01:58 +0000
committerChristopher Faylor <me@cgf.cx>2013-09-16 17:01:58 +0000
commit9a2f0cff8fc6706d16356552b86c1e0c8ba35ddf (patch)
tree5e9d63f638924b7be1c69735247ff6aedd4ff637
parent00fd23d50f7867bbfa8033f895cbf9ba279b98bc (diff)
downloadcygnal-9a2f0cff8fc6706d16356552b86c1e0c8ba35ddf.tar.gz
cygnal-9a2f0cff8fc6706d16356552b86c1e0c8ba35ddf.tar.bz2
cygnal-9a2f0cff8fc6706d16356552b86c1e0c8ba35ddf.zip
* dump_setup.cc (find_tar_ext): Generalize search for .tar extension, avoiding
looking for specific compression types.
-rw-r--r--winsup/utils/ChangeLog5
-rw-r--r--winsup/utils/dump_setup.cc13
2 files changed, 9 insertions, 9 deletions
diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog
index 743913077..69ff8e7bf 100644
--- a/winsup/utils/ChangeLog
+++ b/winsup/utils/ChangeLog
@@ -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.
diff --git a/winsup/utils/dump_setup.cc b/winsup/utils/dump_setup.cc
index ae5fc0446..002c91d9f 100644
--- a/winsup/utils/dump_setup.cc
+++ b/winsup/utils/dump_setup.cc
@@ -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 *