[vala/staging] vala: Fix cleaning of output in CodeContext.pkg_config_modversion()



commit fbe96d189d58293fcfbe7f7ceb7a0dc190b891a0
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Thu Apr 16 10:00:21 2020 +0200

    vala: Fix cleaning of output in CodeContext.pkg_config_modversion()

 vala/valacodecontext.vala | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/vala/valacodecontext.vala b/vala/valacodecontext.vala
index 6ddcd8f5c..6001c901a 100644
--- a/vala/valacodecontext.vala
+++ b/vala/valacodecontext.vala
@@ -879,11 +879,13 @@ public class Vala.CodeContext {
 
                try {
                        Process.spawn_command_line_sync (pc, out output, null, out exit_status);
-                       if (exit_status != 0) {
+                       if (exit_status == 0) {
                                output = output[0:-1];
                                if (output == "") {
                                        output = null;
                                }
+                       } else {
+                               output = null;
                        }
                } catch (SpawnError e) {
                        output = null;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]