Deleted Added
full compact
main.c (253925) main.c (255253)
1/* $NetBSD: main.c,v 1.222 2013/07/18 15:31:49 sjg Exp $ */
1/* $NetBSD: main.c,v 1.224 2013/09/04 15:38:26 sjg Exp $ */
2
3/*
4 * Copyright (c) 1988, 1989, 1990, 1993
5 * The Regents of the University of California. All rights reserved.
6 *
7 * This code is derived from software contributed to Berkeley by
8 * Adam de Boor.
9 *

--- 54 unchanged lines hidden (view full) ---

64 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
65 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
66 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
67 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
68 * SUCH DAMAGE.
69 */
70
71#ifndef MAKE_NATIVE
2
3/*
4 * Copyright (c) 1988, 1989, 1990, 1993
5 * The Regents of the University of California. All rights reserved.
6 *
7 * This code is derived from software contributed to Berkeley by
8 * Adam de Boor.
9 *

--- 54 unchanged lines hidden (view full) ---

64 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
65 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
66 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
67 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
68 * SUCH DAMAGE.
69 */
70
71#ifndef MAKE_NATIVE
72static char rcsid[] = "$NetBSD: main.c,v 1.222 2013/07/18 15:31:49 sjg Exp $";
72static char rcsid[] = "$NetBSD: main.c,v 1.224 2013/09/04 15:38:26 sjg Exp $";
73#else
74#include <sys/cdefs.h>
75#ifndef lint
76__COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993\
77 The Regents of the University of California. All rights reserved.");
78#endif /* not lint */
79
80#ifndef lint
81#if 0
82static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94";
83#else
73#else
74#include <sys/cdefs.h>
75#ifndef lint
76__COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993\
77 The Regents of the University of California. All rights reserved.");
78#endif /* not lint */
79
80#ifndef lint
81#if 0
82static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94";
83#else
84__RCSID("$NetBSD: main.c,v 1.222 2013/07/18 15:31:49 sjg Exp $");
84__RCSID("$NetBSD: main.c,v 1.224 2013/09/04 15:38:26 sjg Exp $");
85#endif
86#endif /* not lint */
87#endif
88
89/*-
90 * main.c --
91 * The main file for this entire program. Exit routines etc
92 * reside here.

--- 1316 unchanged lines hidden (view full) ---

1409{
1410 const char *fname = p; /* makefile to read */
1411 int fd;
1412 size_t len = MAXPATHLEN;
1413 char *name, *path = bmake_malloc(len);
1414
1415 if (!strcmp(fname, "-")) {
1416 Parse_File(NULL /*stdin*/, -1);
85#endif
86#endif /* not lint */
87#endif
88
89/*-
90 * main.c --
91 * The main file for this entire program. Exit routines etc
92 * reside here.

--- 1316 unchanged lines hidden (view full) ---

1409{
1410 const char *fname = p; /* makefile to read */
1411 int fd;
1412 size_t len = MAXPATHLEN;
1413 char *name, *path = bmake_malloc(len);
1414
1415 if (!strcmp(fname, "-")) {
1416 Parse_File(NULL /*stdin*/, -1);
1417 Var_Set("MAKEFILE", "", VAR_GLOBAL, 0);
1417 Var_Set("MAKEFILE", "", VAR_INTERNAL, 0);
1418 } else {
1419 /* if we've chdir'd, rebuild the path name */
1420 if (strcmp(curdir, objdir) && *fname != '/') {
1421 size_t plen = strlen(curdir) + strlen(fname) + 2;
1422 if (len < plen)
1423 path = bmake_realloc(path, len = 2 * plen);
1424
1425 (void)snprintf(path, len, "%s/%s", curdir, fname);

--- 32 unchanged lines hidden (view full) ---

1458 fname = name;
1459 /*
1460 * set the MAKEFILE variable desired by System V fans -- the
1461 * placement of the setting here means it gets set to the last
1462 * makefile specified, as it is set by SysV make.
1463 */
1464found:
1465 if (!doing_depend)
1418 } else {
1419 /* if we've chdir'd, rebuild the path name */
1420 if (strcmp(curdir, objdir) && *fname != '/') {
1421 size_t plen = strlen(curdir) + strlen(fname) + 2;
1422 if (len < plen)
1423 path = bmake_realloc(path, len = 2 * plen);
1424
1425 (void)snprintf(path, len, "%s/%s", curdir, fname);

--- 32 unchanged lines hidden (view full) ---

1458 fname = name;
1459 /*
1460 * set the MAKEFILE variable desired by System V fans -- the
1461 * placement of the setting here means it gets set to the last
1462 * makefile specified, as it is set by SysV make.
1463 */
1464found:
1465 if (!doing_depend)
1466 Var_Set("MAKEFILE", fname, VAR_GLOBAL, 0);
1466 Var_Set("MAKEFILE", fname, VAR_INTERNAL, 0);
1467 Parse_File(fname, fd);
1468 }
1469 free(path);
1470 return(0);
1471}
1472
1473
1474

--- 518 unchanged lines hidden ---
1467 Parse_File(fname, fd);
1468 }
1469 free(path);
1470 return(0);
1471}
1472
1473
1474

--- 518 unchanged lines hidden ---