diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2009-10-23 15:24:42 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2009-10-23 15:24:42 +0000 |
commit | ae2d45fc25191c85584c75c9b2cd704cd6f76653 (patch) | |
tree | 549f381d1896dad5de52216c178d600b3eabe20a | |
parent | 962ce06a55ff57eb21aa97cfc9141dc16c7df3ec (diff) |
When adding text due to an a, c, or i command, don't eat the space(s) at
the beginning of the lines since the addition is supposed to be "verbatim".
From NetBSD, also matches the bahaviour of GNU sed
ok millert@
-rw-r--r-- | usr.bin/sed/compile.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.bin/sed/compile.c b/usr.bin/sed/compile.c index 60c6cac9330..58f8b2823db 100644 --- a/usr.bin/sed/compile.c +++ b/usr.bin/sed/compile.c @@ -1,4 +1,4 @@ -/* $OpenBSD: compile.c,v 1.29 2009/08/07 03:30:56 djm Exp $ */ +/* $OpenBSD: compile.c,v 1.30 2009/10/23 15:24:41 reyk Exp $ */ /*- * Copyright (c) 1992 Diomidis Spinellis. @@ -35,7 +35,7 @@ #ifndef lint /* from: static char sccsid[] = "@(#)compile.c 8.2 (Berkeley) 4/28/95"; */ -static const char rcsid[] = "$OpenBSD: compile.c,v 1.29 2009/08/07 03:30:56 djm Exp $"; +static const char rcsid[] = "$OpenBSD: compile.c,v 1.30 2009/10/23 15:24:41 reyk Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -675,7 +675,6 @@ compile_text(void) text = xrealloc(text, asize); } op = s = text + size; - EATSPACE(); for (esc_nl = 0; *p != '\0'; p++) { if (*p == '\\' && p[1] != '\0' && *++p == '\n') esc_nl = 1; |