Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Feb 1995 22:46:49 +0100 (MET)
From:      guido@gvr.win.tue.nl (Guido van Rooij)
To:        FreeBSD-hackers@freefall.cdrom.com (FreeBSD-hackers)
Subject:   sh patch
Message-ID:  <199502282146.WAA06798@gvr.win.tue.nl>

next in thread | raw e-mail | index | archive | help
I mailed this patch to current. If noone objects, I'll commit it to
the source tree. (I've been running this sh for some time now
without problems).

It solves the problme that not all trailing newlines in a backquote
expansion are deleted. this breaks my Pnews bersion.

-Guido


--- /usr/src/bin/sh/expand.c.orig	Sat Sep 24 04:57:34 1994
+++ /usr/src/bin/sh/expand.c	Sun Feb 26 21:06:38 1995
@@ -402,8 +402,10 @@
 			STPUTC(lastc, dest);
 		}
 	}
-	if (lastc == '\n') {
+	p--;
+	while (lastc == '\n') {
 		STUNPUTC(dest);
+		lastc = *--p;
 	}
 	if (in.fd >= 0)
 		close(in.fd);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199502282146.WAA06798>