[file-roller] rar: use a more solid way to get the version number
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [file-roller] rar: use a more solid way to get the version number
- Date: Mon, 9 Sep 2013 08:49:49 +0000 (UTC)
commit 1427ba9245e8e8de8584b4022a2bdbc2e69a7619
Author: Paolo Bacchilega <paobac src gnome org>
Date: Mon Sep 9 10:22:53 2013 +0200
rar: use a more solid way to get the version number
parse the version number directly
src/fr-command-rar.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/fr-command-rar.c b/src/fr-command-rar.c
index 2bb06bf..e15e1af 100644
--- a/src/fr-command-rar.c
+++ b/src/fr-command-rar.c
@@ -174,9 +174,10 @@ process_line (char *line,
g_return_if_fail (line != NULL);
if (! rar_comm->list_started) {
- if (strncmp (line, "Details:", 8) == 0) {
- rar_comm->rar5 = TRUE;
- return;
+ if (strncmp (line, "RAR ", 4) == 0) {
+ int version;
+ sscanf (line, "RAR %d.", &version);
+ rar_comm->rar5 = (version >= 5);
}
else if (strncmp (line, "--------", 8) == 0) {
rar_comm->list_started = TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]