aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2003-01-09 14:36:26 +0000
committerEric Andersen <andersen@codepoet.org>2003-01-09 14:36:26 +0000
commite931909d2db6e46cc6a260166b20ca880946b623 (patch)
tree78ae2019cb79f621861e8264acded1161c5203fb
parent9e598413750c0decba90222f29104f31b39e5837 (diff)
downloadbusybox-w32-e931909d2db6e46cc6a260166b20ca880946b623.tar.gz
busybox-w32-e931909d2db6e46cc6a260166b20ca880946b623.tar.bz2
busybox-w32-e931909d2db6e46cc6a260166b20ca880946b623.zip
Additional patch from Tito to fix some anomolies
-rw-r--r--miscutils/strings.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/miscutils/strings.c b/miscutils/strings.c
index 3d3aaf589..649485033 100644
--- a/miscutils/strings.c
+++ b/miscutils/strings.c
@@ -44,7 +44,7 @@ int strings_main(int argc, char **argv)
44 char *file; 44 char *file;
45 size_t foff, minlen; 45 size_t foff, minlen;
46 unsigned char *bfr, *C; 46 unsigned char *bfr, *C;
47 47 int i;
48 48
49 exitcode = fflg = oflg = 0; 49 exitcode = fflg = oflg = 0;
50 minlen = -1; 50 minlen = -1;
@@ -96,11 +96,19 @@ int strings_main(int argc, char **argv)
96 if (fflg) 96 if (fflg)
97 printf("%s:", file); 97 printf("%s:", file);
98 if (oflg) 98 if (oflg)
99 printf("%7ld %s", (long)(foff - minlen), (char *)bfr); 99 printf("%7lo %s", (long)(foff - minlen), (char *)bfr);
100 else 100 else
101 printf("%s", bfr); 101 printf("%s", bfr);
102 i=0;
102 while ((ch = getchar()) != EOF && ISSTR(ch)) 103 while ((ch = getchar()) != EOF && ISSTR(ch))
104 {
103 putchar((char)ch); 105 putchar((char)ch);
106 i++;
107 }
108 if(i>0)
109 foff+=(i+1);
110 else
111 foff++;
104 putchar('\n'); 112 putchar('\n');
105 } 113 }
106 cnt = 0; 114 cnt = 0;