From: JazzyNico Date: Wed, 6 Oct 2010 18:58:55 +0000 (+0200) Subject: Extensions. Fix for Bug #652943 (Aborted output extensions create an empty file). X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6a66fb22a9b064d49db980ce175f1858b8a9552a;p=inkscape.git Extensions. Fix for Bug #652943 (Aborted output extensions create an empty file). --- diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index e075feb91..9a461ab2d 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -602,10 +602,14 @@ void Script::save(Inkscape::Extension::Output *module, file_listener fileout; - execute(command, params, tempfilename_in, fileout); + int data_read = execute(command, params, tempfilename_in, fileout); + + bool success = false; - std::string lfilename = Glib::filename_from_utf8(filenameArg); - bool success = fileout.toFile(lfilename); + if (data_read > 0) { + std::string lfilename = Glib::filename_from_utf8(filenameArg); + success = fileout.toFile(lfilename); + } // make sure we don't leak file descriptors from g_file_open_tmp close(tempfd_in);