]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vala: Correctly use Path.build_path()
authorSimon McVittie <smcv@debian.org>
Tue, 19 Mar 2024 02:13:52 +0000 (02:13 +0000)
committerRico Tzschichholz <ricotz@ubuntu.com>
Tue, 19 Mar 2024 08:35:53 +0000 (09:35 +0100)
The first argument to Path.build_path() is a separator, and for it to be
practically useful, at least two subsequent arguments are needed.

Also to find GIR XML in /usr/share we should make the second argument be
an absolute path.

vala/valacodecontext.vala

index 8461403c65507af45bc4887ec94ff8a233b7899f..59ef28c8b54394a9d8094726b3ca92dd563d6884 100644 (file)
@@ -726,13 +726,13 @@ public class Vala.CodeContext {
                }
 
                // Search $GI_GIRDIR set by user or retrieved from gobject-introspection-1.0.pc
-               path = Path.build_path (Config.GI_GIRDIR, girname);
+               path = Path.build_path ("/", Config.GI_GIRDIR, girname);
                if (FileUtils.test (path, FileTest.EXISTS | FileTest.IS_REGULAR)) {
                        return path;
                }
 
                // Search /usr/share
-               path = Path.build_path ("/", "usr", "share", GIR_SUFFIX, girname);
+               path = Path.build_path ("/", "/usr", "share", GIR_SUFFIX, girname);
                if (FileUtils.test (path, FileTest.EXISTS | FileTest.IS_REGULAR)) {
                        return path;
                }