Module Name:    src
Committed By:   dholland
Date:           Sat Dec 25 20:46:18 UTC 2010

Modified Files:
        src/usr.bin/make: parse.c

Log Message:
Maybe fix a problem that appeared on loonix.


To generate a diff of this commit:
cvs rdiff -u -r1.171 -r1.172 src/usr.bin/make/parse.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.171 src/usr.bin/make/parse.c:1.172
--- src/usr.bin/make/parse.c:1.171	Sat Dec 25 17:19:04 2010
+++ src/usr.bin/make/parse.c	Sat Dec 25 20:46:18 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.171 2010/12/25 17:19:04 dholland Exp $	*/
+/*	$NetBSD: parse.c,v 1.172 2010/12/25 20:46:18 dholland Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: parse.c,v 1.171 2010/12/25 17:19:04 dholland Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.172 2010/12/25 20:46:18 dholland Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)parse.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: parse.c,v 1.171 2010/12/25 17:19:04 dholland Exp $");
+__RCSID("$NetBSD: parse.c,v 1.172 2010/12/25 20:46:18 dholland Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -545,8 +545,10 @@
 	assert(bufpos <= lf->len);
 
 	/* truncate malloc region to actual length (maybe not useful) */
-	lf->len = bufpos;
-	lf->buf = bmake_realloc(lf->buf, lf->len);
+	if (lf->len > 0) {
+		lf->len = bufpos;
+		lf->buf = bmake_realloc(lf->buf, lf->len);
+	}
 
 done:
 	if (path != NULL) {

Reply via email to