diff options
author | Olivier Blin <oblin@mandriva.com> | 2007-08-27 13:32:33 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2007-08-27 13:32:33 +0000 |
commit | 7fb5ebcf422d5f870d8c673c838c1f2510a8f16d (patch) | |
tree | cec0ad7748ca9110fe9a5d0e55118f81ad411d6e | |
parent | e54fedfd85f1b8e680f4fb036b70c51706054076 (diff) | |
download | drakx-7fb5ebcf422d5f870d8c673c838c1f2510a8f16d.tar drakx-7fb5ebcf422d5f870d8c673c838c1f2510a8f16d.tar.gz drakx-7fb5ebcf422d5f870d8c673c838c1f2510a8f16d.tar.bz2 drakx-7fb5ebcf422d5f870d8c673c838c1f2510a8f16d.tar.xz drakx-7fb5ebcf422d5f870d8c673c838c1f2510a8f16d.zip |
make filename2modname modify in-place
-rw-r--r-- | mdk-stage1/modules.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/mdk-stage1/modules.c b/mdk-stage1/modules.c index ce61b3f01..9aeaf2a4a 100644 --- a/mdk-stage1/modules.c +++ b/mdk-stage1/modules.c @@ -87,14 +87,12 @@ static char *kernel_module_extension(void) } -static char * filename2modname(char * filename) { - char * modname = strdup(filename); - while (modname && *modname) { - if (*modname == '-') - *modname = '_'; - modname++; +static void filename2modname(char * filename) { + while (filename && *filename) { + if (*filename == '-') + *filename = '_'; + filename++; } - return modname; } static int load_modules_dependencies(void) @@ -131,7 +129,8 @@ static int load_modules_dependencies(void) /* sort of a good line */ modules_deps[line].filename = strdup(start); - modules_deps[line].modname = filename2modname(start); + modules_deps[line].modname = strdup(start); + filename2modname(modules_deps[line].modname); start = ptr; i = 0; |