Fixed segfault with 'cut -f 1 -d:' and added 'cut -s' suport.
[oweals/busybox.git] / sed.c
diff --git a/sed.c b/sed.c
index 2beb2a5888e4948dbde4582ab580aad6a1dcb58e..d4b721e4944fc57226053f886730c60cdc332101 100644 (file)
--- a/sed.c
+++ b/sed.c
@@ -3,7 +3,7 @@
  * Mini sed implementation for busybox
  *
  *
- * Copyright (C) 1999 by Lineo, inc.
+ * Copyright (C) 1999,2000 by Lineo, inc.
  * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
  *
  * Modifications for addresses and append command have been
@@ -38,8 +38,9 @@
 #include <ctype.h>
 
 static const char sed_usage[] =
-       "sed [-n] -e script [file...]\n\n"
-       "Allowed sed scripts come in the following form:\n"
+       "sed [-n] -e script [file...]\n"
+#ifndef BB_FEATURE_TRIVIAL_HELP
+       "\nAllowed sed scripts come in the following form:\n"
        "\t'ADDR [!] COMMAND'\n\n"
        "\twhere address ADDR can be:\n"
        "\t  NUMBER    Match specified line number\n"
@@ -56,10 +57,12 @@ static const char sed_usage[] =
        "-e\tadd the script to the commands to be executed\n"
        "-n\tsuppress automatic printing of pattern space\n\n"
 #if defined BB_REGEXP
-       "This version of sed matches full regular expresions.\n";
+       "This version of sed matches full regular expressions.\n";
 #else
-       "This version of sed matches strings (not full regular expresions).\n";
+       "This version of sed matches strings (not full regular expressions).\n"
 #endif
+#endif
+       ;
 
 /* Flags & variables */
 
@@ -349,7 +352,7 @@ extern int sed_main(int argc, char **argv)
                        fclose(fp);
                }
        }
-       exit(TRUE);
+       return(TRUE);
 }