summaryrefslogtreecommitdiff
path: root/package/busybox/patches/930-stty_bug_fix.patch
blob: f33e6b55f8ebd08d21d6d5ea814bd4cce9e23388 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
--- build_arm/busybox-1.4.1/coreutils/stty.c.old	2007-03-13 12:59:49.000000000 +0100
+++ build_arm/busybox-1.4.1/coreutils/stty.c	2007-03-13 07:51:38.000000000 +0100
@@ -568,10 +568,11 @@
 		NULL
 	};
 	int i = index_in_str_array(params, name);
-	if (i) {
-		if (!(i == 4 || i == 5))
-			i |= 0x80;
-	}
+	if (i < 0)
+		return 0;
+	if (!(i == 4 || i == 5))
+		i |= 0x80;
+
 	return i;
 }
 
@@ -907,6 +908,7 @@
 #define STTY_verbose_output     (1<<2)
 #define STTY_recoverable_output (1<<3)
 #define STTY_noargs             (1<<4)
+int stty_main(int argc, char **argv);
 int stty_main(int argc, char **argv)
 {
 	struct termios mode;