]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Make sure to hash the trailing quote when skipping
authorAnders Björklund <anders@itension.se>
Thu, 14 Jul 2016 21:22:25 +0000 (23:22 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Tue, 19 Jul 2016 14:59:39 +0000 (16:59 +0200)
Turns out that 3.2-maint hashes preprocessor output a bit differently,
so the workaround for skipping certain lines was broken in backport.
When skipping the "extra line", the trailing quotes were missing from
the output causing the hash to be different from the normal output.

ccache.c

index 624036c85feec3d31ac01d2fa22a2e55b3b6f725..49b2092c8f12302dc595b5d05dfa71504ccca279 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -755,9 +755,11 @@ process_preprocessed_file(struct mdfour *hash, const char *path)
                                if (str_startswith(q, "# 31 \"<command-line>\"\n")) {
                                        /* Bogus extra line with #31, after the regular #1:
                                           Ignore the whole line, and continue parsing */
+                                       hash_buffer(hash, p, q - p);
                                        while (q < end && *q != '\n') {
                                                q++;
                                        }
+                                       q++;
                                        p = q;
                                        continue;
                                } else if (str_startswith(q, "# 32 \"<command-line>\" 2\n")) {