[BusyBox-cvs] busybox/miscutils strings.c,1.2,1.3

Erik Andersen andersen at codepoet.org
Thu Jan 9 14:36:31 UTC 2003


Update of /var/cvs/busybox/miscutils
In directory winder:/tmp/cvs-serv25057/miscutils

Modified Files:
	strings.c 
Log Message:
Additional patch from Tito to fix some anomolies


Index: strings.c
===================================================================
RCS file: /var/cvs/busybox/miscutils/strings.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- strings.c	9 Jan 2003 10:00:49 -0000	1.2
+++ strings.c	9 Jan 2003 14:36:26 -0000	1.3
@@ -44,7 +44,7 @@
 	char *file;
 	size_t foff, minlen;
 	unsigned char *bfr, *C;
-
+	int i;
 
 	exitcode = fflg = oflg = 0;
 	minlen = -1;
@@ -96,11 +96,19 @@
 				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;




More information about the busybox-cvs mailing list