diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-09-14 13:57:26 +1000 |
---|---|---|
committer | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-09-14 13:57:26 +1000 |
commit | 0c9d2455301ed633826e222aacd930126990913e (patch) | |
tree | 2353a480f55dfa41d9e6d2fa328af1b60dd3653e /modutils/modutils.c | |
parent | e8db4fe96b3a68b6f971d88084ef2fd2c8513e78 (diff) | |
parent | 9dc04124d5a3f0c9be249287817a964691e187b0 (diff) | |
download | busybox-w32-0c9d2455301ed633826e222aacd930126990913e.tar.gz busybox-w32-0c9d2455301ed633826e222aacd930126990913e.tar.bz2 busybox-w32-0c9d2455301ed633826e222aacd930126990913e.zip |
Merge branch 'origin/master' (early part)
Diffstat (limited to 'modutils/modutils.c')
-rw-r--r-- | modutils/modutils.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/modutils/modutils.c b/modutils/modutils.c index 850a8683b..565d0d22f 100644 --- a/modutils/modutils.c +++ b/modutils/modutils.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Copyright (C) 2008 by Timo Teras <timo.teras@iki.fi> | 4 | * Copyright (C) 2008 by Timo Teras <timo.teras@iki.fi> |
5 | * | 5 | * |
6 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. | 6 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
7 | */ | 7 | */ |
8 | #include "modutils.h" | 8 | #include "modutils.h" |
9 | 9 | ||
@@ -71,8 +71,12 @@ char* FAST_FUNC parse_cmdline_module_options(char **argv) | |||
71 | optlen = 0; | 71 | optlen = 0; |
72 | while (*++argv) { | 72 | while (*++argv) { |
73 | options = xrealloc(options, optlen + 2 + strlen(*argv) + 2); | 73 | options = xrealloc(options, optlen + 2 + strlen(*argv) + 2); |
74 | /* Spaces handled by "" pairs, but no way of escaping quotes */ | 74 | /* Older versions were enclosing space-containing *argv in "", |
75 | optlen += sprintf(options + optlen, (strchr(*argv, ' ') ? "\"%s\" " : "%s "), *argv); | 75 | * but both modprobe and insmod from module-init-tools 3.11.1 |
76 | * don't do this anymore. (As to extra trailing space, | ||
77 | * insmod adds it but modprobe does not. We do in both cases) | ||
78 | */ | ||
79 | optlen += sprintf(options + optlen, "%s ", *argv); | ||
76 | } | 80 | } |
77 | return options; | 81 | return options; |
78 | } | 82 | } |