summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorguido <guido@FreeBSD.org>1995-03-01 13:04:15 +0000
committerguido <guido@FreeBSD.org>1995-03-01 13:04:15 +0000
commita28e8018c87c4db2eca7806a21cf0acc555391a9 (patch)
tree7d23d616c3829649675f9c75bbb3dcc40c91d804 /bin
parent227859a1a69ff1232e1853abcd2a3f742e430a68 (diff)
downloadFreeBSD-src-a28e8018c87c4db2eca7806a21cf0acc555391a9.zip
FreeBSD-src-a28e8018c87c4db2eca7806a21cf0acc555391a9.tar.gz
Fix the deletion of trailing newlines with backquote expansion.
Reviewed by: Submitted by: Obtained from:
Diffstat (limited to 'bin')
-rw-r--r--bin/sh/expand.c6
1 files changed, 4 insertions, 2 deletions
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);
OpenPOWER on IntegriCloud