patch-1.3.79 linux/scripts/lxdialog/util.c

Next file: linux/scripts/patch-kernel
Previous file: linux/scripts/lxdialog/menubox.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.78/linux/scripts/lxdialog/util.c linux/scripts/lxdialog/util.c
@@ -342,13 +342,16 @@
 int
 first_alpha(const char *string)
 {
-	int i, in_paren=0;
+	int i, in_paren=0, c;
 
 	for (i = 0; i < strlen(string); i++) {
-		if (string[i] == '(') ++in_paren;
-		if (string[i] == ')') --in_paren;
+		c = tolower(string[i]);
 
-		if ((! in_paren) && isalpha(string[i]))
+		if (c == '(') ++in_paren;
+		if (c == ')') --in_paren;
+
+		if ((! in_paren) && isalpha(c) && 
+		     strchr("nNyYmM", c) == 0)
 			return i;
 	}
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this