Skip to content

Commit

Permalink
Revert "stream_libarchive: remove "old" rar volume pattern"
Browse files Browse the repository at this point in the history
This reverts commit 1b0129c.

It turns out most of the files affected by the idiotic use-case actually
use this old naming pattern, which I hoped was unused.

This means for now we'll always assume .rar files are multi-part (until
proven otherwise), but the following commit tries to fix this.
  • Loading branch information
wm4 committed Jan 20, 2020
1 parent e666546 commit 3ef0754
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions stream/stream_libarchive.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,13 @@ static char *standard_volume_url(void *ctx, const char *format,
return talloc_asprintf(ctx, format, BSTR_P(base), index);
}

static char *old_rar_volume_url(void *ctx, const char *format,
struct bstr base, int index)
{
return talloc_asprintf(ctx, format, BSTR_P(base),
'r' + index / 100, index % 100);
}

struct file_pattern {
const char *match;
const char *format;
Expand All @@ -234,6 +241,7 @@ static const struct file_pattern patterns[] = {
{ ".part01.rar", "%.*s.part%.2d.rar", standard_volume_url, 2, 99 },
{ ".part001.rar", "%.*s.part%.3d.rar", standard_volume_url, 2, 999 },
{ ".part0001.rar", "%.*s.part%.4d.rar", standard_volume_url, 2, 9999 },
{ ".rar", "%.*s.%c%.2d", old_rar_volume_url, 0, 9999 },
{ ".001", "%.*s.%.3d", standard_volume_url, 2, 9999 },
{ NULL, NULL, NULL, 0, 0 },
};
Expand Down

0 comments on commit 3ef0754

Please sign in to comment.