Module Name: src Committed By: dholland Date: Tue Apr 7 01:52:26 UTC 2009
Modified Files: src/usr.bin/paste: paste.c Log Message: 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.14 -r1.15 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.14 src/usr.bin/paste/paste.c:1.15 --- src/usr.bin/paste/paste.c:1.14 Mon Jul 21 14:19:24 2008 +++ src/usr.bin/paste/paste.c Tue Apr 7 01:52:26 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: paste.c,v 1.14 2008/07/21 14:19:24 lukem Exp $ */ +/* $NetBSD: paste.c,v 1.15 2009/04/07 01:52:26 dholland 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.14 2008/07/21 14:19:24 lukem Exp $"); +__RCSID("$NetBSD: paste.c,v 1.15 2009/04/07 01:52:26 dholland Exp $"); #endif /* not lint */ #include <sys/types.h> @@ -221,6 +221,7 @@ if (!cnt) errx(1, "no delimiters specified."); + *arg = '\0'; return(cnt); }