Module Name:    src
Committed By:   bouyer
Date:           Mon May 18 18:30:02 UTC 2009

Modified Files:
        src/usr.bin/paste [netbsd-4]: paste.c

Log Message:
Pull up following revision(s) (requested by dholland in ticket #1319):
        usr.bin/paste/paste.c: revision 1.15
Null-terminate the delimiter list string after processing escapes
(which can shorten it) because the code that issues delimiters depends
on it being null-terminated. This caused e.g. paste -d '\0' a b to
print a '0' at the beginning of each line. Closes PR 41159.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.12.6.1 src/usr.bin/paste/paste.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/paste/paste.c
diff -u src/usr.bin/paste/paste.c:1.12 src/usr.bin/paste/paste.c:1.12.6.1
--- src/usr.bin/paste/paste.c:1.12	Sat Apr  1 06:36:58 2006
+++ src/usr.bin/paste/paste.c	Mon May 18 18:30:02 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: paste.c,v 1.12 2006/04/01 06:36:58 rtr Exp $	*/
+/*	$NetBSD: paste.c,v 1.12.6.1 2009/05/18 18:30:02 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -40,7 +40,7 @@
 
 #ifndef lint
 /*static char sccsid[] = "from: @(#)paste.c	8.1 (Berkeley) 6/6/93";*/
-__RCSID("$NetBSD: paste.c,v 1.12 2006/04/01 06:36:58 rtr Exp $");
+__RCSID("$NetBSD: paste.c,v 1.12.6.1 2009/05/18 18:30:02 bouyer Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -222,6 +222,7 @@
 
 	if (!cnt)
 		errx(1, "no delimiters specified.");
+	*arg = '\0';
 	return(cnt);
 }
 

Reply via email to