diff options
author | Eric Andersen | 2001-05-07 22:47:45 +0000 |
---|---|---|
committer | Eric Andersen | 2001-05-07 22:47:45 +0000 |
commit | 8f3e51b4adac772957633eaa070bad011f4724ed (patch) | |
tree | 56f14e7812408aff43841a35629248526abf72ce /coreutils | |
parent | 8d35134ad8d83acd76b32eb1e9b6255a00c4556b (diff) | |
download | busybox-8f3e51b4adac772957633eaa070bad011f4724ed.zip busybox-8f3e51b4adac772957633eaa070bad011f4724ed.tar.gz |
Patch from Vladimir to remove testing stuff from stty
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/stty.c | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/coreutils/stty.c b/coreutils/stty.c index 0075b22..1e13433 100644 --- a/coreutils/stty.c +++ b/coreutils/stty.c @@ -1362,76 +1362,9 @@ static const char *visible(unsigned int ch) } #ifdef TEST -unsigned long parse_number(const char *numstr, - const struct suffix_mult *suffixes) -{ - const struct suffix_mult *sm; - unsigned long int ret; - int len; - char *end; - - ret = strtoul(numstr, &end, 10); - if (numstr == end) - error_msg_and_die("invalid number `%s'", numstr); - while (end[0] != '\0') { - sm = suffixes; - while ( sm != 0 ) { - if(sm->suffix) { - len = strlen(sm->suffix); - if (strncmp(sm->suffix, end, len) == 0) { - ret *= sm->mult; - end += len; - break; - } - sm++; - - } else - sm = 0; - } - if (sm == 0) - error_msg_and_die("invalid number `%s'", numstr); - } - return ret; -} const char *applet_name = "stty"; -static void verror_msg(const char *s, va_list p) -{ - fflush(stdout); - fprintf(stderr, "%s: ", applet_name); - vfprintf(stderr, s, p); -} - -extern void error_msg_and_die(const char *s, ...) -{ - va_list p; - - va_start(p, s); - verror_msg(s, p); - va_end(p); - putc('\n', stderr); - exit(EXIT_FAILURE); -} - -static void vperror_msg(const char *s, va_list p) -{ - int err=errno; - verror_msg(s, p); - if (*s) s = ": "; - fprintf(stderr, "%s%s\n", s, strerror(err)); -} - -extern void perror_msg_and_die(const char *s, ...) -{ - va_list p; - - va_start(p, s); - vperror_msg(s, p); - va_end(p); - exit(EXIT_FAILURE); -} - #endif /* |