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,16 +690,21 @@ string DebuggerParser::saveScriptFile(string file)
FilesystemNode node(file);
try
if(node.exists() || out.str().length())
{
node.write(out);
}
catch(...)
{
return "Unable to save script to " + node.getShortPath();
}
try
{
node.write(out);
}
catch(...)
{
return "Unable to save script to " + node.getShortPath();
}
return "saved " + node.getShortPath() + " OK";
return "saved " + node.getShortPath() + " OK";
}
else
return "nothing to save";
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -