- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
[cdrkit.git] / cdrkit-1.1.11-rootstat.patch
blobd9ceb3b1a5f1f5bcb829b4ec3b2a4570ff3c891a
1 diff -up cdrkit-1.1.11/genisoimage/tree.c.rootstat cdrkit-1.1.11/genisoimage/tree.c
2 --- cdrkit-1.1.11/genisoimage/tree.c.rootstat 2011-01-25 14:15:36.766389403 +0100
3 +++ cdrkit-1.1.11/genisoimage/tree.c 2011-01-25 14:17:24.804643126 +0100
4 @@ -48,6 +48,7 @@
5 #include <fctldefs.h>
6 #include <device.h>
7 #include <schily.h>
8 +#include <libgen.h>
10 extern int allow_limited_size;
12 @@ -1421,12 +1422,16 @@ insert_file_entry(struct directory *this
13 return (0);
15 if (this_dir == root && strcmp(short_name, ".") == 0)
16 - root_statbuf = statbuf; /* Save this for later on */
17 + memcpy(&root_statbuf, &statbuf, sizeof(root_statbuf)); /* Save this for later on */
19 /* We do this to make sure that the root entries are consistent */
20 if (this_dir == root && strcmp(short_name, "..") == 0) {
21 - statbuf = root_statbuf;
22 - lstatbuf = root_statbuf;
23 + /* for the case .. comes before . */
24 + if (!root_statbuf.st_ctime) {
25 + stat_filter(dirname(whole_path), &root_statbuf);
26 + }
27 + memcpy(&statbuf, &root_statbuf, sizeof(statbuf));
28 + memcpy(&lstatbuf, &root_statbuf, sizeof(lstatbuf));
30 if (S_ISLNK(lstatbuf.st_mode)) {