Blame SOURCES/cdrkit-1.1.11-rootstat.patch

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