Fix the deletion of trailing newlines with backquote expansion.

Reviewed by:
Submitted by:
Obtained from:
This commit is contained in:
Guido van Rooij 1995-03-01 13:04:15 +00:00
parent ce584e16e7
commit 528ad82b4c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=6804

View File

@ -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);