aboutsummaryrefslogtreecommitdiff
path: root/modutils/modprobe-small.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2015-01-01 19:02:40 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2015-01-01 19:02:40 +0100
commit78854520ebecfd24d5c80a266d6779bd1e069016 (patch)
tree43b2a405b44b07348a26312488513ad1aa171361 /modutils/modprobe-small.c
parent6c19d35f689c911b83073ab1faeffb8040c4b3d9 (diff)
downloadbusybox-w32-78854520ebecfd24d5c80a266d6779bd1e069016.tar.gz
busybox-w32-78854520ebecfd24d5c80a266d6779bd1e069016.tar.bz2
busybox-w32-78854520ebecfd24d5c80a266d6779bd1e069016.zip
modprobe: revert checking for /, stop doing basename() on modprobe args
function old new delta process_module 726 719 -7 filename2modname 81 67 -14 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-21) Total: -21 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'modutils/modprobe-small.c')
-rw-r--r--modutils/modprobe-small.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/modutils/modprobe-small.c b/modutils/modprobe-small.c
index b7990bff1..dafe91ed7 100644
--- a/modutils/modprobe-small.c
+++ b/modutils/modprobe-small.c
@@ -149,9 +149,13 @@ static void replace(char *s, char what, char with)
149static char *filename2modname(const char *filename, char *modname) 149static char *filename2modname(const char *filename, char *modname)
150{ 150{
151 int i; 151 int i;
152 char *from; 152 const char *from;
153 153
154 from = bb_get_last_path_component_nostrip(filename); 154 // Disabled since otherwise "modprobe dir/name" would work
155 // as if it is "modprobe name". It is unclear why
156 // 'basenamization' was here in the first place.
157 //from = bb_get_last_path_component_nostrip(filename);
158 from = filename;
155 for (i = 0; i < (MODULE_NAME_LEN-1) && from[i] != '\0' && from[i] != '.'; i++) 159 for (i = 0; i < (MODULE_NAME_LEN-1) && from[i] != '\0' && from[i] != '.'; i++)
156 modname[i] = (from[i] == '-') ? '_' : from[i]; 160 modname[i] = (from[i] == '-') ? '_' : from[i];
157 modname[i] = '\0'; 161 modname[i] = '\0';