This patch allows -p without value.
Suggested-by: Pavol Cupka <[email protected]>
Signed-off-by: Jaegeuk Kim <[email protected]>
---
fsck/main.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/fsck/main.c b/fsck/main.c
index f35d01d..804f71a 100644
--- a/fsck/main.c
+++ b/fsck/main.c
@@ -184,13 +184,13 @@ void f2fs_parse_options(int argc, char *argv[])
* 0: default level, the same as -a
* 1: check meta
*/
- if (optarg[0] == '-') {
+ if (optarg[0] == '-' || !is_digits(optarg) ||
+ optind == argc) {
+ MSG(0, "Info: Use default preen
mode\n");
c.preen_mode = PREEN_MODE_0;
+ c.auto_fix = 1;
optind--;
break;
- } else if (!is_digits(optarg)) {
- err = EWRONG_OPT;
- break;
}
c.preen_mode = atoi(optarg);
if (c.preen_mode < 0)
--
2.15.0.531.g2ccb3012c9-goog
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel