diff options
author | Eric Andersen <andersen@codepoet.org> | 2001-05-07 22:47:45 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2001-05-07 22:47:45 +0000 |
commit | 8f3e51b4adac772957633eaa070bad011f4724ed (patch) | |
tree | 56f14e7812408aff43841a35629248526abf72ce | |
parent | 8d35134ad8d83acd76b32eb1e9b6255a00c4556b (diff) | |
download | busybox-8f3e51b4adac772957633eaa070bad011f4724ed.tar.gz |
Patch from Vladimir to remove testing stuff from stty
-rw-r--r-- | coreutils/stty.c | 67 | ||||
-rw-r--r-- | stty.c | 67 |
2 files changed, 0 insertions, 134 deletions
diff --git a/coreutils/stty.c b/coreutils/stty.c index 0075b2210..1e1343370 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 /* @@ -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 /* |