From 7f875c5f664ac6606dafde8476778aea602e4f2b Mon Sep 17 00:00:00 2001 From: jkh Date: Thu, 19 Jun 1997 15:14:01 +0000 Subject: >Number: 3780 >Category: bin >Synopsis: WEXITSTATUS() may return nagative value, which causes sh to generate bad $? PR: 3780 Submitted by: sanewo@ba2.so-net.or.jp --- bin/sh/expand.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/sh/expand.c b/bin/sh/expand.c index 04c37a2..a72e351 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: expand.c,v 1.18 1997/05/19 00:18:40 steve Exp $ + * $Id: expand.c,v 1.19 1997/06/06 23:04:33 ache Exp $ */ #ifndef lint @@ -1388,6 +1388,8 @@ cvtnum(num, buf) temp[31] = '\0'; + if (neg) + num = -num; do { *--p = num % 10 + '0'; } while ((num /= 10) != 0); -- cgit v1.1