]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Detect recursive execution of ccache due to misnamed ccache binary
authorJoel Rosdahl <joel@rosdahl.net>
Sun, 9 May 2010 18:03:08 +0000 (20:03 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 9 May 2010 18:03:08 +0000 (20:03 +0200)
ccache.c

index fbc8555cac1a566b16d011b81894356b3d9b8ebe..1c25f72479c3108d3e6e619b75446f7f46d6dc1c 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -1167,6 +1167,10 @@ static void find_compiler(int argc, char **argv)
                stats_update(STATS_COMPILER);
                fatal("Could not find compiler \"%s\" in PATH", base);
        }
+       if (strcmp(compiler, argv[0]) == 0) {
+               fatal("Recursive invocation (the name of the ccache binary"
+                     " must be \"%s\")", MYNAME);
+       }
        orig_args->argv[0] = compiler;
 }