From d3314ffe5521c4154a9ce8b8dc567258eff02442 Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Sun, 9 May 2010 20:02:37 +0200 Subject: [PATCH] Improve compiler detection error message --- ccache.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ccache.c b/ccache.c index fe229814f..fbc8555ca 100644 --- a/ccache.c +++ b/ccache.c @@ -1138,6 +1138,7 @@ static void find_compiler(int argc, char **argv) { char *base; char *path; + char *compiler; orig_args = args_init(argc, argv); @@ -1159,14 +1160,14 @@ static void find_compiler(int argc, char **argv) base = strdup(path); } - orig_args->argv[0] = find_executable(base, MYNAME); + compiler = find_executable(base, MYNAME); /* can't find the compiler! */ - if (!orig_args->argv[0]) { + if (!compiler) { stats_update(STATS_COMPILER); - perror(base); - exit(1); + fatal("Could not find compiler \"%s\" in PATH", base); } + orig_args->argv[0] = compiler; } -- 2.47.2