59 lines
2.1 KiB
Diff
59 lines
2.1 KiB
Diff
From 18bc0b2ee79438b8e35c0769165a9a105e3792a0 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>
|
|
Date: Thu, 31 Mar 2022 23:22:27 +0400
|
|
Subject: [PATCH] wixl: fix g_path_is_absolute() assert with glib >= 2.71
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
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;
|
|
+ }
|
|
}
|
|
}
|
|
|
|
--
|
|
GitLab
|
|
|