Patch from Vladimir to remove testing stuff from stty
authorEric Andersen <andersen@codepoet.org>
Mon, 7 May 2001 22:47:45 +0000 (22:47 -0000)
committerEric Andersen <andersen@codepoet.org>
Mon, 7 May 2001 22:47:45 +0000 (22:47 -0000)
coreutils/stty.c
stty.c

index 0075b22105456f26184df9b7249ecf5f30ab068f..1e134337044cf5d5948a5f25650320e8d07de02e 100644 (file)
@@ -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
 
 /*
diff --git a/stty.c b/stty.c
index 0075b22105456f26184df9b7249ecf5f30ab068f..1e134337044cf5d5948a5f25650320e8d07de02e 100644 (file)
--- a/stty.c
+++ b/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
 
 /*