diff options
author | Michael Stahl <mstahl@redhat.com> | 2012-11-07 17:38:30 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-11-07 18:34:16 +0100 |
commit | c8a8f5e669973cbbc57fe1ed2f87548cd3313714 (patch) | |
tree | 513a6c47f1666837e2dd43d565da1bdd5a0f9cd2 /solenv | |
parent | d6a21d8761b2b8533e259bc0bf220bf27a58d4f0 (diff) |
concat-deps: properly recognize colon that follows target
Should fix cases where for weirdly formatted input files the target was
mangled erroneously.
Change-Id: I28d94a6c714b5f893ac873f84fe2022e96cf1327
Diffstat (limited to 'solenv')
-rw-r--r-- | solenv/bin/concat-deps.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/solenv/bin/concat-deps.c b/solenv/bin/concat-deps.c index 843cad1e6b17..ddbaf2463dc4 100644 --- a/solenv/bin/concat-deps.c +++ b/solenv/bin/concat-deps.c @@ -809,18 +809,25 @@ static inline void print_fullpaths(char* line) char* end; int boost_count = 0; const char * unpacked_end = 0; /* end of UnpackedTarget match (if any) */ - int first = 1; /* for UnpackedTarget the first (target) is GenCxxObject! */ + /* for UnpackedTarget the target is GenC{,xx}Object, dont mangle! */ + int target_seen = 0; token = line; eat_space(&token); while (*token) { end = token; - while (*end && (' ' != *end) && ('\t' != *end)) { + /* hard to believe that in this day and age drive letters still exist */ + if (*end && (':' == *(end+1)) && + (('\\' == *(end+2)) || ('/' == *(end+2))) && isalpha(*end)) + { + end = end + 3; /* only one cross, err drive letter per filename */ + } + while (*end && (' ' != *end) && ('\t' != *end) && (':' != *end)) { ++end; } int token_len = end - token; - if (!first && + if (target_seen && elide_dependency(token, token_len, &boost_count, &unpacked_end)) { if (unpacked_end) @@ -852,9 +859,18 @@ static inline void print_fullpaths(char* line) abort(); fputc(' ', stdout); } - first = 0; token = end; eat_space(&token); + if (!target_seen) + { + if (':' == *token) + { + target_seen = 1; + fputc(':', stdout); + ++token; + eat_space(&token); + } + } } } |