Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2011-02-01 23:24:25 +01:00
parent 55ae0e9238
commit 8ae386bf19

View File

@ -71,12 +71,11 @@ char* FAST_FUNC parse_cmdline_module_options(char **argv)
optlen = 0; optlen = 0;
while (*++argv) { while (*++argv) {
options = xrealloc(options, optlen + 2 + strlen(*argv) + 2); options = xrealloc(options, optlen + 2 + strlen(*argv) + 2);
/* Older versions were enclosing space-containing *argv in "", /* Spaces handled by "" pairs, but no way of escaping quotes */
* but both modprobe and insmod from module-init-tools 3.11.1 //TODO: module-init-tools version 3.11.1 quotes only value:
* don't do this anymore. (As to extra trailing space, //it generates var="val with spaces", not "var=val with spaces"
* insmod adds it but modprobe does not. We do in both cases) //(and it won't quote var *name* even if it has spaces)
*/ optlen += sprintf(options + optlen, (strchr(*argv, ' ') ? "\"%s\" " : "%s "), *argv);
optlen += sprintf(options + optlen, "%s ", *argv);
} }
return options; return options;
} }