diff options
| author | Simon J. Gerraty <sjg@FreeBSD.org> | 2015-12-07 22:51:25 +0000 |
|---|---|---|
| committer | Simon J. Gerraty <sjg@FreeBSD.org> | 2015-12-07 22:51:25 +0000 |
| commit | 7c6c27a0ba74c140cb8bf378239a6d660e8bce0f (patch) | |
| tree | 4a6964d83ff81b1858b2c465a893131c7c81a5dc /parse.c | |
| parent | ce40971ce25292a0274be1ca4e5af0a73db78dd7 (diff) | |
Notes
Diffstat (limited to 'parse.c')
| -rw-r--r-- | parse.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.205 2015/10/11 04:51:24 sjg Exp $ */ +/* $NetBSD: parse.c,v 1.206 2015/11/26 00:23:04 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: parse.c,v 1.205 2015/10/11 04:51:24 sjg Exp $"; +static char rcsid[] = "$NetBSD: parse.c,v 1.206 2015/11/26 00:23:04 sjg 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.205 2015/10/11 04:51:24 sjg Exp $"); +__RCSID("$NetBSD: parse.c,v 1.206 2015/11/26 00:23:04 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -508,7 +508,11 @@ loadfile(const char *path, int fd) #ifdef HAVE_MMAP if (load_getsize(fd, &lf->len) == SUCCESS) { /* found a size, try mmap */ +#ifdef _SC_PAGESIZE pagesize = sysconf(_SC_PAGESIZE); +#else + pagesize = 0; +#endif if (pagesize <= 0) { pagesize = 0x1000; } @@ -2390,15 +2394,19 @@ static void ParseTrackInput(const char *name) { char *old; + char *ep; char *fp = NULL; size_t name_len = strlen(name); old = Var_Value(MAKE_MAKEFILES, VAR_GLOBAL, &fp); if (old) { + ep = old + strlen(old) - name_len; /* does it contain name? */ for (; old != NULL; old = strchr(old, ' ')) { if (*old == ' ') old++; + if (old >= ep) + break; /* cannot contain name */ if (memcmp(old, name, name_len) == 0 && (old[name_len] == 0 || old[name_len] == ' ')) goto cleanup; |
