From: Vern Paxson Date: Sat, 2 Oct 1993 15:20:15 +0000 (+0000) Subject: If -+ used, output to lex.yy.cc X-Git-Tag: flex-2-5-5b~391 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=759ab635e1695b80236ee1b4d4ea3b7586126ff5;p=flex If -+ used, output to lex.yy.cc --- diff --git a/main.c b/main.c index c9104a6..4678464 100644 --- a/main.c +++ b/main.c @@ -97,9 +97,9 @@ int num_input_files; char *program_name; #ifndef SHORT_FILE_NAMES -static char *outfile_template = "lex.%s.c"; +static char *outfile_template = "lex.%s.%s"; #else -static char *outfile_template = "lex%s.c"; +static char *outfile_template = "lex%s.%s"; #endif static char outfile_path[64]; @@ -643,8 +643,14 @@ char **argv; if ( ! use_stdout ) { FILE *prev_stdout; + char *suffix; - sprintf( outfile_path, outfile_template, prefix ); + if ( C_plus_plus ) + suffix = "cc"; + else + suffix = "c"; + + sprintf( outfile_path, outfile_template, prefix, suffix ); prev_stdout = freopen( outfile_path, "w", stdout );