From cbd6e657442ebec5bacf29ae69cbd954c7fac65d Mon Sep 17 00:00:00 2001
From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Date: Sun, 4 Feb 2007 11:13:57 +0000
Subject: - fix buglet introduced in r17351 in find_param(). Closes #1193

---
 coreutils/stty.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/coreutils/stty.c b/coreutils/stty.c
index c354aac9c..15cb05293 100644
--- a/coreutils/stty.c
+++ b/coreutils/stty.c
@@ -568,10 +568,11 @@ static int find_param(const char * const name)
 		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;
 }
 
-- 
cgit v1.2.3-55-g6feb