]>
Commit | Line | Data |
---|---|---|
9b0ff0a0 MT |
1 | Submitted By: Bruce Dubbs (bdubbs at linuxfromscratch dot org) |
2 | Date: 2006-07-15 | |
3 | Initial Package Version: 3.2.2 | |
4 | Origin: | |
5 | Upstream Status: This is fixed in 3.3-pre1 | |
6 | Description: Updates modprobe functionality to fix problem where | |
7 | aliases don't quite work properly | |
8 | ||
9 | --- module-init-tools-3.2.2/modprobe.c 2005-12-01 15:42:09.000000000 -0800 | |
10 | +++ module-init-tools-3.3-pre1/modprobe.c 2006-02-04 15:18:07.000000000 -0800 | |
11 | @@ -990,13 +990,27 @@ | |
12 | return ret; | |
13 | } | |
14 | ||
15 | +/* Careful! Don't munge - in [ ] as per Debian Bug#350915 */ | |
16 | static char *underscores(char *string) | |
17 | { | |
18 | if (string) { | |
19 | unsigned int i; | |
20 | - for (i = 0; string[i]; i++) | |
21 | - if (string[i] == '-') | |
22 | - string[i] = '_'; | |
23 | + int inbracket = 0; | |
24 | + for (i = 0; string[i]; i++) { | |
25 | + switch (string[i]) { | |
26 | + case '[': | |
27 | + inbracket++; | |
28 | + break; | |
29 | + case ']': | |
30 | + inbracket--; | |
31 | + break; | |
32 | + case '-': | |
33 | + if (!inbracket) | |
34 | + string[i] = '_'; | |
35 | + } | |
36 | + } | |
37 | + if (inbracket) | |
38 | + warn("Unmatched bracket in %s\n", string); | |
39 | } | |
40 | return string; | |
41 | } |