From a28e8018c87c4db2eca7806a21cf0acc555391a9 Mon Sep 17 00:00:00 2001 From: guido Date: Wed, 1 Mar 1995 13:04:15 +0000 Subject: Fix the deletion of trailing newlines with backquote expansion. Reviewed by: Submitted by: Obtained from: --- bin/sh/expand.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/sh/expand.c b/bin/sh/expand.c index 099c266..11474aa 100644 --- a/bin/sh/expand.c +++ b/bin/sh/expand.c @@ -33,7 +33,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: expand.c,v 1.2 1994/09/24 02:57:34 davidg Exp $ */ #ifndef lint @@ -402,8 +402,10 @@ expbackq(cmd, quoted, flag) STPUTC(lastc, dest); } } - if (lastc == '\n') { + p--; + while (lastc == '\n') { STUNPUTC(dest); + lastc = *--p; } if (in.fd >= 0) close(in.fd); -- cgit v1.1