aboutsummaryrefslogtreecommitdiff
path: root/util-linux/switch_root.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-02-13 17:25:31 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-02-13 17:25:31 +0000
commit6dd03f04ea3292d10ce06feda2f0c8272be0fb83 (patch)
treed7fa90ad831980ff9f0283f6b780c0f3879c7c84 /util-linux/switch_root.c
parent87cf2ee8abec24e6399653e4856ab3543e7aadf7 (diff)
downloadbusybox-6dd03f04ea3292d10ce06feda2f0c8272be0fb83.tar.gz
switch_root: stop at first non-option. Closes bug 1425.
Diffstat (limited to 'util-linux/switch_root.c')
-rw-r--r--util-linux/switch_root.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/util-linux/switch_root.c b/util-linux/switch_root.c
index 700f7997e..bd1e9d5ce 100644
--- a/util-linux/switch_root.c
+++ b/util-linux/switch_root.c
@@ -73,8 +73,8 @@ int switch_root_main(int argc, char **argv)
// Parse args (-c console)
- opt_complementary = "-2";
- getopt32(argv, "c:", &console);
+ opt_complementary = "-2"; // minimum 2 params
+ getopt32(argv, "+c:", &console); // '+': stop parsing at first non-option
argv += optind;
// Change to new root directory and verify it's a different fs.