Rediffing fix_link_obt.patch.
[debian/openbox.git] / debian / patches / 07_fix_xml_load_file.patch
CommitLineData
d8ec5405
DB
1Authors: Nico Golde <nion@debian.org>
2 Eugenio Paolantonio <me@medesimo.eu>
3Description:
4 Do not build filename if a working full path is given (Closes: #644756).
5
6diff -Naurp openbox.orig/obt/xml.c openbox/obt/xml.c
7--- openbox.orig/obt/xml.c 2012-07-09 18:35:18.598429073 +0200
8+++ openbox/obt/xml.c 2012-07-09 19:06:14.038251536 +0200
9@@ -127,10 +127,13 @@ static gboolean load_file(ObtXmlInst *i,
274a7f84
DB
10 gchar *path;
11 struct stat s;
12
13- if (!domain && !filename) /* given a full path to the file */
14+ if (!domain && !filename){ /* given a full path to the file */
15 path = g_strdup(it->data);
16- else
17+ } else if(filename && filename[0] == '/' && stat(filename, &s) >= 0) {
18+ path = g_strdup(filename);
19+ } else {
20 path = g_build_filename(it->data, domain, filename, NULL);
21+ }
22
23 if (stat(path, &s) >= 0) {
24 /* XML_PARSE_BLANKS is needed apparently, or the tree can end up