aboutsummaryrefslogtreecommitdiff
path: root/coreutils/stty.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2007-01-17 19:46:46 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2007-01-17 19:46:46 +0000
commit79cc55975fd35c2864871fdff942522e7295aa80 (patch)
tree283b4e2e2e6fe62fd7fd07b8b34399f11c51a6a9 /coreutils/stty.c
parent8eb0549e5dedcc379839e91cec70ddbee0dc8130 (diff)
downloadbusybox-w32-79cc55975fd35c2864871fdff942522e7295aa80.tar.gz
busybox-w32-79cc55975fd35c2864871fdff942522e7295aa80.tar.bz2
busybox-w32-79cc55975fd35c2864871fdff942522e7295aa80.zip
- remove superfluous define that expanded to "!strcmp"
- remove some dead code
Diffstat (limited to 'coreutils/stty.c')
-rw-r--r--coreutils/stty.c25
1 files changed, 3 insertions, 22 deletions
diff --git a/coreutils/stty.c b/coreutils/stty.c
index 69dee30b3..7206f2d11 100644
--- a/coreutils/stty.c
+++ b/coreutils/stty.c
@@ -450,9 +450,6 @@ static void perror_on_device(const char *fmt)
450 bb_perror_msg(fmt, device_name); 450 bb_perror_msg(fmt, device_name);
451} 451}
452 452
453/* No, inline won't be as efficient (gcc 3.4.3) */
454#define streq(a,b) (!strcmp((a),(b)))
455
456/* Print format string MESSAGE and optional args. 453/* Print format string MESSAGE and optional args.
457 Wrap to next line first if it won't fit. 454 Wrap to next line first if it won't fit.
458 Print a space first unless MESSAGE will start a new line */ 455 Print a space first unless MESSAGE will start a new line */
@@ -531,7 +528,7 @@ static const struct mode_info *find_mode(const char *name)
531{ 528{
532 int i; 529 int i;
533 for (i = 0; i < NUM_mode_info; ++i) 530 for (i = 0; i < NUM_mode_info; ++i)
534 if (streq(name, mode_info[i].name)) 531 if (!strcmp(name, mode_info[i].name))
535 return &mode_info[i]; 532 return &mode_info[i];
536 return 0; 533 return 0;
537} 534}
@@ -540,7 +537,7 @@ static const struct control_info *find_control(const char *name)
540{ 537{
541 int i; 538 int i;
542 for (i = 0; i < NUM_control_info; ++i) 539 for (i = 0; i < NUM_control_info; ++i)
543 if (streq(name, control_info[i].name)) 540 if (!strcmp(name, control_info[i].name))
544 return &control_info[i]; 541 return &control_info[i];
545 return 0; 542 return 0;
546} 543}
@@ -558,21 +555,6 @@ enum {
558 555
559static int find_param(const char * const name) 556static int find_param(const char * const name)
560{ 557{
561#if 0
562#ifdef HAVE_C_LINE
563 if (streq(name, "line")) return param_line;
564#endif
565#ifdef TIOCGWINSZ
566 if (streq(name, "rows")) return param_rows;
567 if (streq(name, "cols")) return param_cols;
568 if (streq(name, "columns")) return param_cols;
569 if (streq(name, "size")) return param_size;
570#endif
571 if (streq(name, "speed")) return param_speed;
572 if (streq(name, "ispeed")) return param_ispeed;
573 if (streq(name, "ospeed")) return param_ospeed;
574 return 0;
575#else
576 const char * const params[] = { 558 const char * const params[] = {
577 "line", 559 "line",
578 "rows", 560 "rows",
@@ -590,7 +572,6 @@ static int find_param(const char * const name)
590 i |= 0x80; 572 i |= 0x80;
591 } 573 }
592 return i; 574 return i;
593#endif
594} 575}
595 576
596static int recover_mode(const char *arg, struct termios *mode) 577static int recover_mode(const char *arg, struct termios *mode)
@@ -909,7 +890,7 @@ static void set_control_char_or_die(const struct control_info *info,
909 value = xatoul_range_sfx(arg, 0, 0xff, stty_suffixes); 890 value = xatoul_range_sfx(arg, 0, 0xff, stty_suffixes);
910 else if (arg[0] == '\0' || arg[1] == '\0') 891 else if (arg[0] == '\0' || arg[1] == '\0')
911 value = arg[0]; 892 value = arg[0];
912 else if (streq(arg, "^-") || streq(arg, "undef")) 893 else if (!strcmp(arg, "^-") || !strcmp(arg, "undef"))
913 value = _POSIX_VDISABLE; 894 value = _POSIX_VDISABLE;
914 else if (arg[0] == '^') { /* Ignore any trailing junk (^Cjunk) */ 895 else if (arg[0] == '^') { /* Ignore any trailing junk (^Cjunk) */
915 value = arg[1] & 0x1f; /* Non-letters get weird results */ 896 value = arg[1] & 0x1f; /* Non-letters get weird results */