Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/make Avoid full path meta file names for subdir of ....
details: https://anonhg.NetBSD.org/src/rev/9f1fe8684af3
branches: trunk
changeset: 355711:9f1fe8684af3
user: sjg <sjg%NetBSD.org@localhost>
date: Thu Aug 10 21:07:48 2017 +0000
description:
Avoid full path meta file names for subdir of .OBJDIR
diffstat:
usr.bin/make/meta.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diffs (36 lines):
diff -r 1e741043518c -r 9f1fe8684af3 usr.bin/make/meta.c
--- a/usr.bin/make/meta.c Thu Aug 10 20:43:12 2017 +0000
+++ b/usr.bin/make/meta.c Thu Aug 10 21:07:48 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: meta.c,v 1.68 2017/07/09 04:54:00 sjg Exp $ */
+/* $NetBSD: meta.c,v 1.69 2017/08/10 21:07:48 sjg Exp $ */
/*
* Implement 'meta' mode.
@@ -246,6 +246,8 @@
char *rp;
char *cp;
char *tp;
+ char *dtp;
+ size_t ldname;
/*
* Weed out relative paths from the target file name.
@@ -282,10 +284,15 @@
}
/* on some systems dirname may modify its arg */
tp = bmake_strdup(tname);
- if (strcmp(dname, dirname(tp)) == 0)
+ dtp = dirname(tp);
+ if (strcmp(dname, dtp) == 0)
snprintf(mname, mnamelen, "%s.meta", tname);
else {
- snprintf(mname, mnamelen, "%s/%s.meta", dname, tname);
+ ldname = strlen(dname);
+ if (strncmp(dname, dtp, ldname) == 0 && dtp[ldname] == '/')
+ snprintf(mname, mnamelen, "%s/%s.meta", dname, &tname[ldname+1]);
+ else
+ snprintf(mname, mnamelen, "%s/%s.meta", dname, tname);
/*
* Replace path separators in the file name after the
Home |
Main Index |
Thread Index |
Old Index