prevent creating lots of zero-size debugger script files when autosave is enabled

This commit is contained in:
Thomas Jentzsch 2021-10-21 14:07:33 +02:00
parent 7be3a3b18e
commit 50c85d735c
1 changed files with 13 additions and 8 deletions

View File

@ -690,6 +690,8 @@ string DebuggerParser::saveScriptFile(string file)
FilesystemNode node(file); FilesystemNode node(file);
if(node.exists() || out.str().length())
{
try try
{ {
node.write(out); node.write(out);
@ -700,6 +702,9 @@ string DebuggerParser::saveScriptFile(string file)
} }
return "saved " + node.getShortPath() + " OK"; return "saved " + node.getShortPath() + " OK";
}
else
return "nothing to save";
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -