Module Name: src Committed By: sjg Date: Tue Feb 8 05:29:13 UTC 2011
Modified Files: src/usr.bin/make: meta.c Log Message: tmplen should be static To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/meta.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/meta.c diff -u src/usr.bin/make/meta.c:1.6 src/usr.bin/make/meta.c:1.7 --- src/usr.bin/make/meta.c:1.6 Wed Dec 15 23:03:35 2010 +++ src/usr.bin/make/meta.c Tue Feb 8 05:29:13 2011 @@ -713,7 +713,7 @@ char *p; char *cp; size_t cwdlen; - size_t tmplen = 0; + static size_t tmplen = 0; FILE *fp; Boolean ignoreOODATE = FALSE; @@ -781,6 +781,10 @@ /* Delimit the record type. */ p = buf; +#ifdef DEBUG_META_MODE + if (DEBUG(META)) + fprintf(debug_file, "%s: %d: %s\n", fname, lineno, buf); +#endif strsep(&p, " "); if (f) { /* @@ -840,6 +844,10 @@ /* Skip past the pid. */ if (strsep(&p, " ") == NULL) continue; +#ifdef DEBUG_META_MODE + if (DEBUG(META)) + fprintf(debug_file, "%s: %d: cwd=%s ldir=%s\n", fname, lineno, cwd, latestdir); +#endif break; } @@ -876,7 +884,7 @@ * they are _expected_ to change. */ if (strncmp(p, "/tmp/", 5) == 0 || - strncmp(p, tmpdir, tmplen) == 0) + (tmplen > 0 && strncmp(p, tmpdir, tmplen) == 0)) break; if (strncmp(p, "/var/", 5) == 0) @@ -919,12 +927,20 @@ sdirs[sdx++] = NULL; for (sdp = sdirs; *sdp && !found; sdp++) { +#ifdef DEBUG_META_MODE + if (DEBUG(META)) + fprintf(debug_file, "%s: %d: looking for: %s\n", fname, lineno, *sdp); +#endif if (stat(*sdp, &fs) == 0) { found = 1; p = *sdp; } } if (found) { +#ifdef DEBUG_META_MODE + if (DEBUG(META)) + fprintf(debug_file, "%s: %d: found: %s\n", fname, lineno, p); +#endif if (!S_ISDIR(fs.st_mode) && fs.st_mtime > gn->mtime) { if (DEBUG(META))