Module Name: src Committed By: sjg Date: Wed May 10 22:26:14 UTC 2017
Modified Files: src/usr.bin/make: main.c Log Message: Main_SetObjdir: ensure buf2 is in scope To generate a diff of this commit: cvs rdiff -u -r1.264 -r1.265 src/usr.bin/make/main.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/main.c diff -u src/usr.bin/make/main.c:1.264 src/usr.bin/make/main.c:1.265 --- src/usr.bin/make/main.c:1.264 Thu Apr 20 03:57:27 2017 +++ src/usr.bin/make/main.c Wed May 10 22:26:14 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.264 2017/04/20 03:57:27 sjg Exp $ */ +/* $NetBSD: main.c,v 1.265 2017/05/10 22:26:14 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,7 +69,7 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: main.c,v 1.264 2017/04/20 03:57:27 sjg Exp $"; +static char rcsid[] = "$NetBSD: main.c,v 1.265 2017/05/10 22:26:14 sjg Exp $"; #else #include <sys/cdefs.h> #ifndef lint @@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19 #if 0 static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: main.c,v 1.264 2017/04/20 03:57:27 sjg Exp $"); +__RCSID("$NetBSD: main.c,v 1.265 2017/05/10 22:26:14 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -720,6 +720,7 @@ Main_SetObjdir(const char *fmt, ...) struct stat sb; char *path; char buf[MAXPATHLEN + 1]; + char buf2[MAXPATHLEN + 1]; Boolean rc = FALSE; va_list ap; @@ -728,8 +729,6 @@ Main_SetObjdir(const char *fmt, ...) va_end(ap); if (path[0] != '/') { - char buf2[MAXPATHLEN + 1]; - snprintf(buf2, MAXPATHLEN, "%s/%s", curdir, path); path = buf2; }