summaryrefslogtreecommitdiffstats
path: root/winsup/utils/dump_setup.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/utils/dump_setup.cc')
-rw-r--r--winsup/utils/dump_setup.cc13
1 files changed, 4 insertions, 9 deletions
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 *