summaryrefslogtreecommitdiffstats
path: root/bin/sh/expand.c
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1997-06-19 15:14:01 +0000
committerjkh <jkh@FreeBSD.org>1997-06-19 15:14:01 +0000
commit7f875c5f664ac6606dafde8476778aea602e4f2b (patch)
tree562d1e34fba4ea27386d3efb596102519cef5d43 /bin/sh/expand.c
parent8e9b467863393231854d6a580e2157e48ba1e8a9 (diff)
downloadFreeBSD-src-7f875c5f664ac6606dafde8476778aea602e4f2b.zip
FreeBSD-src-7f875c5f664ac6606dafde8476778aea602e4f2b.tar.gz
>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
Diffstat (limited to 'bin/sh/expand.c')
-rw-r--r--bin/sh/expand.c4
1 files changed, 3 insertions, 1 deletions
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);
OpenPOWER on IntegriCloud