From 3ef0754102541f731916060f81a8653e387ee2a6 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 20 Jan 2020 18:15:52 +0100 Subject: Revert "stream_libarchive: remove "old" rar volume pattern" This reverts commit 1b0129c4143fe73ef0ee3c3f1e2bed734c374d40. 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. --- stream/stream_libarchive.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/stream/stream_libarchive.c b/stream/stream_libarchive.c index eca5c73153..795ac45030 100644 --- a/stream/stream_libarchive.c +++ b/stream/stream_libarchive.c @@ -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; @@ -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 }, }; -- cgit v1.2.3