diff options
author | nectar <nectar@FreeBSD.org> | 1998-07-27 21:15:52 +0000 |
---|---|---|
committer | nectar <nectar@FreeBSD.org> | 1998-07-27 21:15:52 +0000 |
commit | 2d26d6b5aa7a7643f3602d894080284d91385565 (patch) | |
tree | 05625bcea454a3d2d4c922c10ac7f280ad1e0cd4 /bin/csh | |
parent | d3ce1542c8c6c45b760f7bf089d043d3ba30c1d6 (diff) | |
download | FreeBSD-src-2d26d6b5aa7a7643f3602d894080284d91385565.zip FreeBSD-src-2d26d6b5aa7a7643f3602d894080284d91385565.tar.gz |
csh built-in printf now expands arguments. e.g.
printf '%d\n' `echo 23`
now works as expected.
PR: bin/2969
Submitted by: Gareth McCaughan <gjm11@dpmms.cam.ac.uk>
Diffstat (limited to 'bin/csh')
-rw-r--r-- | bin/csh/func.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/bin/csh/func.c b/bin/csh/func.c index 42dad63..1b8da96 100644 --- a/bin/csh/func.c +++ b/bin/csh/func.c @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)func.c 8.1 (Berkeley) 5/31/93"; #else static const char rcsid[] = - "$Id: func.c,v 1.9 1997/08/08 00:54:03 steve Exp $"; + "$Id: func.c,v 1.10 1998/02/28 10:49:56 jraynard Exp $"; #endif #endif /* not lint */ @@ -1491,10 +1491,23 @@ doprintf(v, t) Char **v; struct command *t; { + Char **newv; char **c; extern int progprintf __P((int, char **)); int ret; + gflag = 0; + tglob(v); + if (gflag) { + newv = globall(v); + if (newv == 0) { + stderror(ERR_NAME | ERR_NOMATCH); + return; + } + v = newv; + gargv=0; + } + ret = progprintf(blklen(v), c = short2blk(v)); (void) fflush(cshout); (void) fflush(csherr); |