-rw-r--r-- | lib/sitecing_enflesher.ll | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/sitecing_enflesher.ll b/lib/sitecing_enflesher.ll index 46489c7..bb667be 100644 --- a/lib/sitecing_enflesher.ll +++ b/lib/sitecing_enflesher.ll @@ -179,6 +179,7 @@ void sitecing_enflesher::enflesh() { throw preprocessor_error(CODEPOINT,"failed to open skeleton file"); switch_streams(&ifs,NULL); yylex(); + outs_close(); } void sitecing_enflesher::anchor() { @@ -188,7 +189,7 @@ void sitecing_enflesher::anchor() { anchor_time = false; } -void sitecing_enflesher::outs_open(const string& nfile) { +void sitecing_enflesher::outs_close() { if(!outs_filename.empty()) { outs.flush(); outs.close(); @@ -244,6 +245,11 @@ void sitecing_enflesher::outs_open(const string& nfile) { throw preprocessor_error(CODEPOINT,"failed to rename() generated output"); } } + outs_filename.erase(); +} + +void sitecing_enflesher::outs_open(const string& nfile) { + outs_close(); outs_filename = nfile; outs.open((nfile+".new").c_str(),ios::trunc); if(!outs.good()) |