aboutsummaryrefslogtreecommitdiff
path: root/coreutils/echo.c
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2000-07-14 18:39:08 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2000-07-14 18:39:08 +0000
commitfbcc2c5f075a88eb4c0c305b577220a1e1f8ff4d (patch)
tree2ccbcd48f335161c647be3f2c296cae06aceb671 /coreutils/echo.c
parent223879b57be61bfb6142e42b6b8da8b334cdb479 (diff)
downloadbusybox-w32-fbcc2c5f075a88eb4c0c305b577220a1e1f8ff4d.tar.gz
busybox-w32-fbcc2c5f075a88eb4c0c305b577220a1e1f8ff4d.tar.bz2
busybox-w32-fbcc2c5f075a88eb4c0c305b577220a1e1f8ff4d.zip
Getopt'ed by Marc Nijdam <marc_nijdam@hp.com>
-Erik git-svn-id: svn://busybox.net/trunk/busybox@860 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'coreutils/echo.c')
-rw-r--r--coreutils/echo.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/coreutils/echo.c b/coreutils/echo.c
index 6e279d1c6..387ea3fef 100644
--- a/coreutils/echo.c
+++ b/coreutils/echo.c
@@ -45,23 +45,24 @@ echo_main(int argc, char** argv)
45 int nflag = 0; 45 int nflag = 0;
46 int eflag = 0; 46 int eflag = 0;
47 47
48 ap = argv; 48
49 if (argc) 49 while ((c = getopt(argc, argv, "neE")) != EOF) {
50 ap++; 50 switch (c) {
51 while ((p = *ap) != NULL && *p == '-') { 51 case 'n':
52 if (strcmp(p, "-n")==0) {
53 nflag = 1; 52 nflag = 1;
54 } else if (strcmp(p, "-e")==0) { 53 break;
54 case 'e':
55 eflag = 1; 55 eflag = 1;
56 } else if (strcmp(p, "-E")==0) { 56 break;
57 case 'E':
57 eflag = 0; 58 eflag = 0;
59 break;
60 default:
61 usage(uname_usage);
58 } 62 }
59 else if (strncmp(p, "--", 2)==0) {
60 usage( uname_usage);
61 }
62 else break;
63 ap++;
64 } 63 }
64
65 ap = &argv[optind];
65 while ((p = *ap++) != NULL) { 66 while ((p = *ap++) != NULL) {
66 while ((c = *p++) != '\0') { 67 while ((c = *p++) != '\0') {
67 if (c == '\\' && eflag) { 68 if (c == '\\' && eflag) {