diff options
author | Vern Paxson <vern@ee.lbl.gov> | 1993-10-02 15:20:15 +0000 |
---|---|---|
committer | Vern Paxson <vern@ee.lbl.gov> | 1993-10-02 15:20:15 +0000 |
commit | 759ab635e1695b80236ee1b4d4ea3b7586126ff5 (patch) | |
tree | a6aa41d0371ae1948042dd5e637cc8f83b680eb1 | |
parent | c5d8db8d39ab03dd579900b948b0e206bc0e5a0a (diff) |
If -+ used, output to lex.yy.cc
-rw-r--r-- | main.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -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 ); |