diff options
author | Eric Andersen <andersen@codepoet.org> | 2003-01-09 14:36:26 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2003-01-09 14:36:26 +0000 |
commit | e931909d2db6e46cc6a260166b20ca880946b623 (patch) | |
tree | 78ae2019cb79f621861e8264acded1161c5203fb | |
parent | 9e598413750c0decba90222f29104f31b39e5837 (diff) |
Additional patch from Tito to fix some anomolies
-rw-r--r-- | miscutils/strings.c | 12 |
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) char *file; size_t foff, minlen; unsigned char *bfr, *C; - + int i; exitcode = fflg = oflg = 0; minlen = -1; @@ -96,11 +96,19 @@ int strings_main(int argc, char **argv) if (fflg) printf("%s:", file); if (oflg) - printf("%7ld %s", (long)(foff - minlen), (char *)bfr); + printf("%7lo %s", (long)(foff - minlen), (char *)bfr); else printf("%s", bfr); + i=0; while ((ch = getchar()) != EOF && ISSTR(ch)) + { putchar((char)ch); + i++; + } + if(i>0) + foff+=(i+1); + else + foff++; putchar('\n'); } cnt = 0; |