[msitools: 1/2] wixl: fix g_path_is_absolute() assert with glib >= 2.71




commit 18bc0b2ee79438b8e35c0769165a9a105e3792a0
Author: Marc-André Lureau <marcandre lureau redhat com>
Date:   Thu Mar 31 23:22:27 2022 +0400

    wixl: fix g_path_is_absolute() assert with glib >= 2.71
    
    Since glib commit 3a6e8bc887 ("gio: check the given child name is not an
    absolute path"), it is no longer acceptable to pass an absolute path to
    g_file_get_child().
    
    Signed-off-by: Marc-André Lureau <marcandre lureau redhat com>

 tools/wixl/builder.vala | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)
---
diff --git a/tools/wixl/builder.vala b/tools/wixl/builder.vala
index 09095fa..f8a7068 100644
--- a/tools/wixl/builder.vala
+++ b/tools/wixl/builder.vala
@@ -777,16 +777,23 @@ namespace Wixl {
         File? find_file (string name, out FileInfo info) throws GLib.Error {
             info = null;
 
-            foreach (var p in path) {
-                var file = p.get_child (name);
-                try {
-                    info = file.query_info ("standard::*", 0, null);
-                    if (info != null)
-                        return file;
-                } catch (IOError error) {
-                    if (error is IOError.NOT_FOUND)
-                        continue;
-                    throw error;
+            if (Path.is_absolute (name)) {
+                var file = File.new_for_path (name);
+                info = file.query_info ("standard::*", 0, null);
+                if (info != null)
+                    return file;
+            } else {
+                foreach (var p in path) {
+                    var file = p.get_child (name);
+                    try {
+                        info = file.query_info ("standard::*", 0, null);
+                        if (info != null)
+                            return file;
+                    } catch (IOError error) {
+                        if (error is IOError.NOT_FOUND)
+                            continue;
+                        throw error;
+                    }
                 }
             }
 


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