File: 04_fix_xml_load_file.patch

package info (click to toggle)
openbox 3.7~rc2-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 5,892 kB
  • sloc: ansic: 38,834; xml: 1,358; sh: 665; makefile: 613; python: 421
file content (25 lines) | stat: -rw-r--r-- 1,008 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
by Nico Golde <nion@debian.org>, slightly modified version
from Eugenio Paolantonio <me@medesimo.eu>
Do not build filename if a working full path is given.
Fixes #644756.
Index: openbox-3.5.0/obt/xml.c
===================================================================
--- openbox-3.5.0.orig/obt/xml.c	2011-10-30 14:13:07.000000000 +0100
+++ openbox-3.5.0/obt/xml.c	2011-10-30 14:13:10.000000000 +0100
@@ -127,10 +127,13 @@
         gchar *path;
         struct stat s;
 
-        if (!domain && !filename) /* given a full path to the file */
+        if (!domain && !filename){ /* given a full path to the file */
             path = g_strdup(it->data);
-        else
+        } else if(filename && filename[0] == '/' && stat(filename, &s) >= 0) {
+            path = g_strdup(filename);
+        } else {
             path = g_build_filename(it->data, domain, filename, NULL);
+        }
 
         if (stat(path, &s) >= 0) {
             /* XML_PARSE_BLANKS is needed apparently, or the tree can end up