* [PATCH] fsck: Fix parsing of -r
@ 2015-04-29 16:49 Stanislav Brabec
2015-05-05 11:04 ` Karel Zak
0 siblings, 1 reply; 2+ messages in thread
From: Stanislav Brabec @ 2015-04-29 16:49 UTC (permalink / raw)
To: util-linux
Fix regression introduced by commit 658c089: -r cannot be used as a last
option:
fsck -r /dev/sda1
fsck: invalid argument -r: '/dev/sda1'
Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
---
disk-utils/fsck.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/disk-utils/fsck.c b/disk-utils/fsck.c
index bd2bf36..465e6d3 100644
--- a/disk-utils/fsck.c
+++ b/disk-utils/fsck.c
@@ -1525,7 +1525,7 @@ static void parse_argv(int argc, char *argv[])
if (arg[j+1]) { /* -r<fd> */
report_stats_fd = strtou32_or_err(arg+j+1, _("invalid argument -r"));
goto next_arg;
- } else if (i+1 < argc && *argv[i+1] != '-') { /* -r <fd> */
+ } else if (i+1 < argc && *argv[i+1] >= '0' && *argv[i+1] <= '9') { /* -r <fd> */
report_stats_fd = strtou32_or_err(argv[i+1], _("invalid argument -r"));
++i;
goto next_arg;
--
2.3.5
--
Best Regards / S pozdravem,
Stanislav Brabec
software developer
---------------------------------------------------------------------
SUSE LINUX, s. r. o. e-mail: sbrabec@suse.cz
Lihovarská 1060/12 tel: +49 911 7405384547
190 00 Praha 9 fax: +420 284 084 001
Czech Republic http://www.suse.cz/
PGP: 830B 40D5 9E05 35D8 5E27 6FA3 717C 209F A04F CD76
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-05-05 11:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-29 16:49 [PATCH] fsck: Fix parsing of -r Stanislav Brabec
2015-05-05 11:04 ` Karel Zak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox