+char *
+strip_compression_suffix (const char *name)
+{
+ char *s = NULL;
+ size_t len;
+
+ if (find_compression_suffix (name, &len))
+ {
+ if (strncmp (name + len - 4, ".tar", 4) == 0)
+ len -= 4;
+ if (len == 0)
+ return NULL;
+ s = xmalloc (len + 1);
+ memcpy (s, name, len);
+ s[len] = 0;
+ }
+ return s;
+}
+