summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/fr-command-rar.c24
1 files changed, 4 insertions, 20 deletions
diff --git a/src/fr-command-rar.c b/src/fr-command-rar.c
index d6a724e..7e69fd9 100644
--- a/src/fr-command-rar.c
+++ b/src/fr-command-rar.c
@@ -194,35 +194,19 @@ process_line (char *line,
g_return_if_fail (line != NULL);
if (! rar_comm->list_started) {
- if (strncmp (line, "RAR ", 4) == 0) {
- int version;
- sscanf (line, "RAR %d.", &version);
- rar_comm->rar5 = (version >= 5);
-
- if (version > 5)
- date_newstyle = TRUE;
- else if (version == 5)
- {
- sscanf (line, "RAR 5.%d ", &version);
- if (version >= 30)
- date_newstyle = TRUE;
- }
+ int version = 0;
- }
- else if (strncmp (line, "UNRAR ", 6) == 0) {
- int version;
- sscanf (line, "UNRAR %d.", &version);
+ if (sscanf (line, "RAR %d.", &version) == 1 || sscanf (line, "UNRAR %d.", &version) == 1) {
rar_comm->rar5 = (version >= 5);
if (version > 5)
date_newstyle = TRUE;
- else if (version == 5)
+ else if (version == 5 && (sscanf (line, "RAR 5.%d ", &version) == 1 ||
+ sscanf (line, "UNRAR 5.%d ", &version) == 1))
{
- sscanf (line, "UNRAR 5.%d ", &version);
if (version >= 30)
date_newstyle = TRUE;
}
-
}
else if (strncmp (line, "--------", 8) == 0) {
rar_comm->list_started = TRUE;