summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--src/input.c6
2 files changed, 7 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index a01503a..e7253d1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2005-10-01  Herbert Xu <herbert@gondor.apana.org.au>
+
+	* Skip NUL characters properly in input.c
+
 2005-03-28  Herbert Xu <herbert@gondor.apana.org.au>
 
 	* Removed some unnecessary inclusions of input.h.
diff --git a/src/input.c b/src/input.c
index 8c874c6..8a43824 100644
--- a/src/input.c
+++ b/src/input.c
@@ -300,9 +300,9 @@ again:
 	something = 0;
 #endif
 	for (more = 1; more;) {
-		switch (*p) {
+		switch (*p++) {
 		case '\0':
-			p++;	/* Skip nul */
+			p = memmove(q, p, parselleft);
 			goto check;
 
 #ifndef SMALL
@@ -323,7 +323,7 @@ again:
 #endif
 		}
 
-		*q++ = *p++;
+		q++;
 check:
 		if (--parselleft <= 0 && more) {
 			parsenleft = q - parsenextc - 1;
it/tests/t0106-diff.sh?id=e405e4589d81cfc30f6cf0b4304f744c7f6e972d&follow=1'>Fix tests for diff spansJune McEnroe 2021-01-20Avoid matching ':' in make tagsJune McEnroe 2021-01-19Prefer tag matches not preceded by [[:alnum:]]June McEnroe 2021-01-19Escape \ and / in mtags search patternsJune McEnroe 2021-01-20Use mtags in source-filterJune McEnroe 2021-01-19Add mtags to generate tags for make and mdocJune McEnroe 2021-01-19Map tags to IDs using only [[:alnum:]-._]June McEnroe 2021-01-19Don't use a pager if reading standard inputJune McEnroe 2021-01-19Support BSD make syntax and match *.amJune McEnroe 2021-01-19Match tab following escaped newline in make assignmentsJune McEnroe 2021-01-18Allow matching lexers using first input lineJune McEnroe