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 + + * dump_setup.cc (find_tar_ext): Generalize search for .tar extension, + avoiding looking for specific compression types. + 2013-08-23 Christopher Faylor * 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 *