|
@@ -62,7 +62,7 @@ find_compression_suffix (const char *name, size_t *ret_len)
|
|
|
{
|
|
|
size_t len;
|
|
|
struct compression_suffix *p;
|
|
|
-
|
|
|
+
|
|
|
suf++;
|
|
|
len = strlen (suf);
|
|
|
|
|
@@ -101,10 +101,14 @@ strip_compression_suffix (const char *name)
|
|
|
{
|
|
|
char *s = NULL;
|
|
|
size_t len;
|
|
|
+ struct compression_suffix const *p = find_compression_suffix (name, &len);
|
|
|
|
|
|
- if (find_compression_suffix (name, &len))
|
|
|
+ if (p)
|
|
|
{
|
|
|
- if (strncmp (name + len - 4, ".tar", 4) == 0)
|
|
|
+ /* Strip an additional ".tar" suffix, but only if the just-stripped
|
|
|
+ "outer" suffix did not begin with "t". */
|
|
|
+ if (len > 4 && strncmp (name + len - 4, ".tar", 4) == 0
|
|
|
+ && p->suffix[0] != 't')
|
|
|
len -= 4;
|
|
|
if (len == 0)
|
|
|
return NULL;
|
|
@@ -114,4 +118,3 @@ strip_compression_suffix (const char *name)
|
|
|
}
|
|
|
return s;
|
|
|
}
|
|
|
-
|