[cdmake] Set correct dates for directory entries
authorHervé Poussineau <hpoussin@reactos.org>
Sun, 11 Jan 2015 20:43:41 +0000 (20:43 +0000)
committerHervé Poussineau <hpoussin@reactos.org>
Sun, 11 Jan 2015 20:43:41 +0000 (20:43 +0000)
Set directory creation date to creation date of its parent, and fix root directory creation date.

This fixes a off-by-one month if ISO was created between February and December,
and invalid dates if ISO was created in January.

svn path=/trunk/; revision=66029

reactos/tools/cdmake/cdmake.c

index 0a8f299..3014209 100644 (file)
@@ -1077,6 +1077,7 @@ new_empty_dirrecord(PDIR_RECORD d, BOOL directory)
     new_d->next_in_directory = d->first_record;
     d->first_record = new_d;
     new_d->next_in_memory = root.next_in_memory;
+    new_d->date_and_time = d->date_and_time;
     root.next_in_memory = new_d;
     if (directory)
     {
@@ -1703,7 +1704,7 @@ int main(int argc, char **argv)
   root.level = 1;
   root.flags = DIRECTORY_FLAG;
   root.date_and_time.year = current_time->tm_year + 1900;
-  root.date_and_time.month = current_time->tm_mon;
+  root.date_and_time.month = current_time->tm_mon + 1;
   root.date_and_time.day = current_time->tm_mday;
   root.date_and_time.hour = current_time->tm_hour;
   root.date_and_time.minute = current_time->tm_min;