summaryrefslogtreecommitdiffstats
path: root/sbin/fsdb/fsdb.c
diff options
context:
space:
mode:
authorgreen <green@FreeBSD.org>2002-01-25 18:31:57 +0000
committergreen <green@FreeBSD.org>2002-01-25 18:31:57 +0000
commite1821d6556e665d02db48ae15e2cff8347285339 (patch)
tree61ddf6b7f196d256a0f261988215c65286cb9238 /sbin/fsdb/fsdb.c
parent92a87afd2221229ecdada434c87ce0033e7049aa (diff)
downloadFreeBSD-src-e1821d6556e665d02db48ae15e2cff8347285339.zip
FreeBSD-src-e1821d6556e665d02db48ae15e2cff8347285339.tar.gz
Allow fsdb the ability to work with entries named with whitespace embedded.
This works by retokenizing a line with a split limit so that if the argument count for a command is greater than the number of arguments formed by splitting apart the line of user input, the last argument is instead all of the remainder of the input line. Yes, I needed this capability at one point to fix a filesystem manually, which happened to break with a problematic space-containing directory entry.
Diffstat (limited to 'sbin/fsdb/fsdb.c')
-rw-r--r--sbin/fsdb/fsdb.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sbin/fsdb/fsdb.c b/sbin/fsdb/fsdb.c
index 59364cb..3da298a 100644
--- a/sbin/fsdb/fsdb.c
+++ b/sbin/fsdb/fsdb.c
@@ -259,7 +259,11 @@ cmdloop()
else if (cmd_argc >= cmdp->minargc &&
cmd_argc <= cmdp->maxargc)
rval = (*cmdp->handler)(cmd_argc, cmd_argv);
- else
+ else if (cmd_argc >= cmdp->minargc) {
+ strcpy(line, elline);
+ cmd_argv = recrack(line, &cmd_argc, cmdp->maxargc);
+ rval = (*cmdp->handler)(cmd_argc, cmd_argv);
+ } else
rval = argcount(cmdp, cmd_argc, cmd_argv);
known = 1;
break;
@@ -494,7 +498,7 @@ CMDFUNCSTART(rm)
printf("Name `%s' removed\n", argv[1]);
return 0;
} else {
- printf("could not remove name? weird.\n");
+ printf("could not remove name ('%s')? weird.\n", argv[1]);
return 1;
}
}
OpenPOWER on IntegriCloud