Blame SOURCES/a2ps-forward-null.patch
|
|
0d8902 |
diff -up a2ps-4.14/lib/pathwalk.c.forward-null a2ps-4.14/lib/pathwalk.c
|
|
|
0d8902 |
--- a2ps-4.14/lib/pathwalk.c.forward-null 2011-08-10 16:06:53.185942197 +0100
|
|
|
0d8902 |
+++ a2ps-4.14/lib/pathwalk.c 2011-08-10 16:08:36.831030924 +0100
|
|
|
0d8902 |
@@ -348,12 +348,12 @@ xpw_find_included_file (char * const *pa
|
|
|
0d8902 |
/* Relative. Give its root. */
|
|
|
0d8902 |
dir = dir_name (including_file);
|
|
|
0d8902 |
|
|
|
0d8902 |
- res = ALLOCA (char, (strlen (dir)
|
|
|
0d8902 |
+ res = ALLOCA (char, ((dir ? strlen (dir) : 0)
|
|
|
0d8902 |
+ strlen (name)
|
|
|
0d8902 |
+ (suffix ? strlen (suffix) : 0)
|
|
|
0d8902 |
+ 2));
|
|
|
0d8902 |
- sprintf (res, "%s%c%s%s", dir, DIRECTORY_SEPARATOR,
|
|
|
0d8902 |
- name, suffix ? suffix : "");
|
|
|
0d8902 |
+ sprintf (res, "%s%c%s%s", dir ? dir : "", DIRECTORY_SEPARATOR,
|
|
|
0d8902 |
+ dir ? name : name + 1, suffix ? suffix : "");
|
|
|
0d8902 |
XFREE (dir);
|
|
|
0d8902 |
if (stat (res, &statbuf) == 0)
|
|
|
0d8902 |
return xstrdup (res);
|