]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Correctly handle "#line N" (without path) directive for AIX's preprocessor
authorJoel Rosdahl <joel@rosdahl.net>
Sun, 14 Nov 2010 10:00:04 +0000 (11:00 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 14 Nov 2010 10:00:04 +0000 (11:00 +0100)
ccache.c

index 6022dd31ded27a2bc2a3b3be2d1b328a6498989a..ee6c5ff7380a316fc635f6d66b889b45cd2ca1ab 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -460,9 +460,13 @@ process_preprocessed_file(struct mdfour *hash, const char *path)
                    && (q == data || q[-1] == '\n')) {
                        char *path;
 
-                       while (q < end && *q != '"') {
+                       while (q < end && *q != '"' && *q != '\n') {
                                q++;
                        }
+                       if (q < end && *q == '\n') {
+                               /* A newline before the quotation mark -> no match. */
+                               continue;
+                       }
                        q++;
                        if (q >= end) {
                                cc_log("Failed to parse included file path");