summaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-01-27 23:24:31 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-01-27 23:24:31 +0000
commitda42bd5bbe6fdda12133e7305b1a3e7cee506cc8 (patch)
treedf7566cc1c7929958ac5137e984ccba755ec693e /coreutils
parentef67c5758a3eeeac2a4cf57559ff967210f7feab (diff)
downloadbusybox-w32-da42bd5bbe6fdda12133e7305b1a3e7cee506cc8.tar.gz
busybox-w32-da42bd5bbe6fdda12133e7305b1a3e7cee506cc8.tar.bz2
busybox-w32-da42bd5bbe6fdda12133e7305b1a3e7cee506cc8.zip
stty: fix mishandling of 'control' keywords (Ralf Friedl <Ralf.Friedl@online.de>)
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/stty.c24
1 files changed, 4 insertions, 20 deletions
diff --git a/coreutils/stty.c b/coreutils/stty.c
index ade2468a8..298fb5b70 100644
--- a/coreutils/stty.c
+++ b/coreutils/stty.c
@@ -780,30 +780,14 @@ static const struct suffix_mult stty_suffixes[] = {
780 780
781static const struct mode_info *find_mode(const char *name) 781static const struct mode_info *find_mode(const char *name)
782{ 782{
783 int i = 0; 783 int i = index_in_strings(mode_name, name);
784 const char *m = mode_name; 784 return i >= 0 ? &mode_info[i] : NULL;
785
786 while (*m) {
787 if (strcmp(name, m) == 0)
788 return &mode_info[i];
789 m += strlen(m) + 1;
790 i++;
791 }
792 return NULL;
793} 785}
794 786
795static const struct control_info *find_control(const char *name) 787static const struct control_info *find_control(const char *name)
796{ 788{
797 int i = 0; 789 int i = index_in_strings(control_name, name);
798 const char *m = mode_name; 790 return i >= 0 ? &control_info[i] : NULL;
799
800 while (*m) {
801 if (strcmp(name, m) == 0)
802 return &control_info[i];
803 m += strlen(m) + 1;
804 i++;
805 }
806 return NULL;
807} 791}
808 792
809enum { 793enum {