diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2021-12-04 07:16:58 +0100 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2021-12-06 11:24:06 +0100 |
commit | 4415d2410cae282da8f8970c393561ec67fc5171 (patch) | |
tree | c329c2a3604a3b8e3c8720254260c016587991b9 /solenv/bin | |
parent | 51c3d8d7f6a2a3b95e97b9a151df0e63ff09cb74 (diff) |
concat-deps: ignore /./ segments in input paths
concat-deps detects relative path segments (AKA /../) and
removes these in cancel_relative(...) to save space (by removing
the preceding path segment from the output path). But that logic
doesn't account for preceding /./ segments, resulting in paths
to non-existing files. This then resulted in mysterious, unneeded
compiling of seemingly unchanged files for my incremental
cross-toolset builds.
I actually assumed some error in my complex gbuild static changes,
which are already driving me crazy...
"make -d" showed these wrong paths, but inspecting the ".d" for
the actual files (from gcc output), they were ok; took me a while
to realize the problem were LO's concat-dep files for libraries.
But instead of complicating cancel_relative(), this just jumps
over /./ segments in the input path. cancel_relative() works on
the &cursor_out copy anyway.
Change-Id: I2a8ecd04fdfa790859668d690a102cfb156aa649
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126345
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'solenv/bin')
-rw-r--r-- | solenv/bin/concat-deps.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/solenv/bin/concat-deps.c b/solenv/bin/concat-deps.c index a9e433ebe88e..fd128f6e3e4c 100644 --- a/solenv/bin/concat-deps.c +++ b/solenv/bin/concat-deps.c @@ -944,6 +944,14 @@ static int process(struct hash* dep_hash, char* fn) } else if(*cursor == '/') { + if(cursor + 2 < end) + { + if(!memcmp(cursor, "/./", 3)) + { + cursor += 2; + continue; + } + } if(cursor + 3 < end) { if(!memcmp(cursor, "/../", 4)) @@ -1008,6 +1016,7 @@ static int process(struct hash* dep_hash, char* fn) *cursor_out++ = *cursor++; } } + /* just in case the file did not end with a \n, there may be a pending rule */ if(base < cursor_out) { |