From 265ed8f9301256bbdbf0ffb9861ee876481c4154 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Mon, 27 Jul 2009 17:07:14 +0000 Subject: [PATCH] Do not initialize the code translation engine when only pre-processing --- src/c99.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/c99.c b/src/c99.c index 6dbfd5e..29833bd 100644 --- a/src/c99.c +++ b/src/c99.c @@ -55,15 +55,20 @@ C99 * c99_new(C99Prefs const * prefs, char const * pathname) return NULL; } if((c99->outfile = _new_outfile(prefs->flags, prefs->outfile, pathname)) - == NULL - || (c99->code = code_new(prefs, c99->outfile)) == NULL) + == NULL) { c99_delete(c99); return NULL; } - /* if not pre-processing we can already return */ - if(!(prefs->flags & C99PREFS_E)) + if(!(prefs->flags & C99PREFS_E)) /* we're not pre-processing */ + { + if((c99->code = code_new(prefs, c99->outfile)) == NULL) + { + c99_delete(c99); + return NULL; + } return c99; + } if(c99->outfile[0] == '\0') { c99->outfp = stdout;