Commit cf2819b2 authored by John Peterson's avatar John Peterson Committed by Jean-Baptiste Kempf

rar: + Support for up to 1001 volume old naming style archive.

(cherry picked from commit 0ba86c34)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 0c3e5b21
......@@ -286,7 +286,7 @@ static const rar_pattern_t *FindVolumePattern(const char *location)
{ ".part1.rar", "%s.part%.1d.rar", 2, 9 },
{ ".part01.rar", "%s.part%.2d.rar", 2, 99, },
{ ".part001.rar", "%s.part%.3d.rar", 2, 999 },
{ ".rar", "%s.r%.2d", 0, 99 },
{ ".rar", "%s.%c%.2d", 0, 999 },
{ NULL, NULL, 0, 0 },
};
......@@ -376,8 +376,14 @@ int RarParse(stream_t *s, int *count, rar_file_t ***file)
}
free(volume_mrl);
if (pattern->start) {
if (asprintf(&volume_mrl, pattern->format, volume_base, volume_index) < 0)
volume_mrl = NULL;
} else {
if (asprintf(&volume_mrl, pattern->format, volume_base,
'r' + volume_index / 100, volume_index % 100) < 0)
volume_mrl = NULL;
}
free(volume_base);
if (!volume_mrl)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment