Commit 0ba86c34 authored by John Peterson's avatar John Peterson Committed by Laurent Aimar

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

parent 1fcf4a83
......@@ -289,7 +289,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 },
};
......@@ -379,8 +379,14 @@ int RarParse(stream_t *s, int *count, rar_file_t ***file)
}
free(volume_mrl);
if (asprintf(&volume_mrl, pattern->format, volume_base, volume_index) < 0)
volume_mrl = NULL;
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