diff options
author | rbuj <[email protected]> | 2019-09-18 15:04:25 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2019-09-30 14:44:38 +0200 |
commit | f25804efa335294b633759e19ae8d4964bd9614e (patch) | |
tree | e821aaa8f10d88432e0eedee32c8f047bcc07c76 | |
parent | f9b691342ef346a4fe2491043899b710fe412c33 (diff) | |
download | engrampa-f25804efa335294b633759e19ae8d4964bd9614e.tar.bz2 engrampa-f25804efa335294b633759e19ae8d4964bd9614e.tar.xz |
ar: don't remove leading whitespaces in filename field
test:
$ touch " test"
$ touch " test"
$ ar r test.a " test" " test"
$ ar tv test.a
rw-rw-r-- 1000/1001 0 Sep 18 14:58 2019 test
rw-rw-r-- 1000/1001 0 Sep 18 14:58 2019 test
$ engrampa test.a
-rw-r--r-- | src/fr-command-ar.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/fr-command-ar.c b/src/fr-command-ar.c index e1397be..af767ca 100644 --- a/src/fr-command-ar.c +++ b/src/fr-command-ar.c @@ -102,15 +102,15 @@ ar_get_last_field (const char *line, while ((field_n > 0) && (*f_end != 0)) { if (*f_end == ' ') { field_n--; - if (field_n != 0) { - while ((*f_end == ' ') && (*f_end != *line)) - f_end++; + if (field_n == 1) f_start = f_end; - } - } else - f_end++; + } + f_end++; } + if (*f_start == ' ') + f_start++; + return g_strdup (f_start); } |