From: Andrew Tridgell Date: Wed, 27 Mar 2002 04:53:05 +0000 (+0100) Subject: handle -S with -c (it changes the default extension) X-Git-Tag: v1.0~35 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b93b8ff936c2851c040f25260e3e6fb03639ce97;p=thirdparty%2Fccache.git handle -S with -c (it changes the default extension) --- diff --git a/ccache.c b/ccache.c index 231228100..c250640ee 100644 --- a/ccache.c +++ b/ccache.c @@ -331,6 +331,7 @@ static void process_args(int argc, char **argv) { int i; int found_c_opt = 0; + int found_S_opt = 0; char *input_file = NULL; stripped_args = args_init(); @@ -349,6 +350,13 @@ static void process_args(int argc, char **argv) found_c_opt = 1; continue; } + + /* -S changes the default extension */ + if (strcmp(argv[i], "-S") == 0) { + args_add(stripped_args, argv[i]); + found_S_opt = 1; + continue; + } /* we need to work out where the output was meant to go */ if (strcmp(argv[i], "-o") == 0) { @@ -426,7 +434,7 @@ static void process_args(int argc, char **argv) cc_log("badly formed output_file %s\n", output_file); failed(); } - p[1] = 'o'; + p[1] = found_S_opt ? 's' : 'o'; p[2] = 0; #if 0 cc_log("Formed output file %s from input_file %s\n",