aboutsummaryrefslogtreecommitdiff
path: root/modutils/modutils.c
diff options
context:
space:
mode:
Diffstat (limited to 'modutils/modutils.c')
-rw-r--r--modutils/modutils.c10
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}