From 02f13c4aae3586aec38ed4fd675da55a4052d2e0 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 10 Feb 2004 01:31:08 +0000 Subject: [PATCH] The header and the jamfile cache both normalize the paths of target files now. This should avoid that jamming from another directory invalidates teh cache due to differing relative paths. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6547 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/tools/jam/hcache.c | 8 +++++++- src/tools/jam/jcache.c | 12 +++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/tools/jam/hcache.c b/src/tools/jam/hcache.c index 849b0e2c33..54a3bd8170 100644 --- a/src/tools/jam/hcache.c +++ b/src/tools/jam/hcache.c @@ -348,10 +348,16 @@ hcache (TARGET *t, LIST *hdrscan) { HCACHEDATA cachedata, *c = &cachedata; LIST *l = 0; + char _normalizedPath[PATH_MAX]; + char *normalizedPath = normalize_path(t->boundname, _normalizedPath, + sizeof(_normalizedPath)); ++queries; - c->boundname = t->boundname; + if (normalizedPath) + c->boundname = normalizedPath; + else + c->boundname = t->boundname; if (hashcheck (hcachehash, (HASHDATA **) &c)) { diff --git a/src/tools/jam/jcache.c b/src/tools/jam/jcache.c index de120a7720..5342b96256 100644 --- a/src/tools/jam/jcache.c +++ b/src/tools/jam/jcache.c @@ -338,7 +338,7 @@ find_jcache_entry(jamfile_cache* cache, char* filename) { jcache_entry _entry; jcache_entry* entry = &_entry; -entry->filename = filename; + entry->filename = filename; if (!hashcheck(cache->entries, (HASHDATA**)&entry)) entry = 0; return entry; @@ -624,12 +624,18 @@ jcache_done(void) contents of the specified file, or 0, if an error occured. */ char** -jcache(char *filename) +jcache(char *_filename) { char** strings = 0; jamfile_cache* cache = get_jcache(); - // get file time time_t time; + // normalize the filename + char _normalizedPath[PATH_MAX]; + char *filename = normalize_path(_filename, _normalizedPath, + sizeof(_normalizedPath)); + if (!filename) + filename = _filename; + // get file time if (!cache) return 0; if (file_time(filename, &time) == 0) {