diff --git a/gui/Scyther/Bin/scyther-linux b/gui/Scyther/Bin/scyther-linux index 5894897..3fd66a5 100755 Binary files a/gui/Scyther/Bin/scyther-linux and b/gui/Scyther/Bin/scyther-linux differ diff --git a/gui/Scyther/Bin/scyther-w32.exe b/gui/Scyther/Bin/scyther-w32.exe index f8ff82b..7f698c4 100755 Binary files a/gui/Scyther/Bin/scyther-w32.exe and b/gui/Scyther/Bin/scyther-w32.exe differ diff --git a/gui/Scyther/Scyther.py b/gui/Scyther/Scyther.py index aac0133..6975a59 100755 --- a/gui/Scyther/Scyther.py +++ b/gui/Scyther/Scyther.py @@ -162,7 +162,7 @@ class Scyther(object): self.cmd = "\"%s\"" % self.program if self.xml: self.cmd += " --dot-output --xml-output --plain" - self.cmd += " --errors=%s" % (errorfile.name) + self.cmd += " --append-errors=%s" % (errorfile.name) self.cmd += " " + self.options # Start the process, push input, get output @@ -171,6 +171,7 @@ class Scyther(object): stdin.write(self.spdl) stdin.close() output = stdout.read() + stdout.close() # get errors # filter out any non-errors (say maybe only claim etc) and count @@ -184,7 +185,6 @@ class Scyther(object): self.errorcount = len(self.errors) # close - stdout.close() errorfile.close() if self.xml: diff --git a/src/switches.c b/src/switches.c index b22d949..670098a 100644 --- a/src/switches.c +++ b/src/switches.c @@ -1298,13 +1298,61 @@ switcher (const int process, int index, int commandline) } } + if (detect (' ', "append-output", 1)) + { + if (!process) + { + helptext (" --append-output=", + "append output file [stdout]"); + } + else + { + // Set output file name + /* try to open */ + if (!freopen (arg_pointer, "a", stdout)) + { + printfstderr ("Could not create output file '%s'.\n", + arg_pointer); + exit (1); + } + arg_next (); + return index; + } + } + if (detect (' ', "errors", 1)) { if (!process) { if (switches.expert) { - helptext (" --errors=", "append errors to file [stderr]"); + helptext (" --errors=", + "write errors to file [stderr]"); + } + } + else + { + // Set output file name + /* try to open */ + if (!freopen (arg_pointer, "w", stderr)) + { + printfstderr ("Could not create error file '%s'.\n", + arg_pointer); + exit (1); + } + arg_next (); + return index; + } + } + + if (detect (' ', "append-errors", 1)) + { + if (!process) + { + if (switches.expert) + { + helptext (" --append-errors=", + "append errors to file [stderr]"); } } else @@ -1313,7 +1361,7 @@ switcher (const int process, int index, int commandline) /* try to open */ if (!freopen (arg_pointer, "a", stderr)) { - printfstderr ("Could not create error file '%s'.\n", + printfstderr ("Could not create append error file '%s'.\n", arg_pointer); exit (1); }