Blame SOURCES/cdrkit-1.1.11-rootstat.patch

224c4d
diff -up cdrkit-1.1.11/genisoimage/tree.c.rootstat cdrkit-1.1.11/genisoimage/tree.c
224c4d
--- cdrkit-1.1.11/genisoimage/tree.c.rootstat	2011-01-25 14:15:36.766389403 +0100
224c4d
+++ cdrkit-1.1.11/genisoimage/tree.c	2011-01-25 14:17:24.804643126 +0100
224c4d
@@ -48,6 +48,7 @@
224c4d
 #include <fctldefs.h>
224c4d
 #include <device.h>
224c4d
 #include <schily.h>
224c4d
+#include <libgen.h>
224c4d
 
224c4d
 extern int allow_limited_size;
224c4d
 
224c4d
@@ -1421,12 +1422,16 @@ insert_file_entry(struct directory *this
224c4d
 		return (0);
224c4d
 	}
224c4d
 	if (this_dir == root && strcmp(short_name, ".") == 0)
224c4d
-		root_statbuf = statbuf;	/* Save this for later on */
224c4d
+		memcpy(&root_statbuf, &statbuf, sizeof(root_statbuf));  /* Save this for later on */
224c4d
 
224c4d
 	/* We do this to make sure that the root entries are consistent */
224c4d
 	if (this_dir == root && strcmp(short_name, "..") == 0) {
224c4d
-		statbuf = root_statbuf;
224c4d
-		lstatbuf = root_statbuf;
224c4d
+		/* for the case .. comes before . */
224c4d
+		if (!root_statbuf.st_ctime) {
224c4d
+			stat_filter(dirname(whole_path), &root_statbuf);
224c4d
+		}
224c4d
+		memcpy(&statbuf, &root_statbuf, sizeof(statbuf));
224c4d
+		memcpy(&lstatbuf, &root_statbuf, sizeof(lstatbuf));
224c4d
 	}
224c4d
 	if (S_ISLNK(lstatbuf.st_mode)) {
224c4d