]> Dogcows Code - chaz/tar/commitdiff
(to_chars_subst): Update comment regarding OLDGNU
authorSergey Poznyakoff <gray@gnu.org.ua>
Mon, 24 Jul 2006 09:13:21 +0000 (09:13 +0000)
committerSergey Poznyakoff <gray@gnu.org.ua>
Mon, 24 Jul 2006 09:13:21 +0000 (09:13 +0000)
vs. GNU format differences.
(mode_to_chars): Treat OLDGNU_FORMAT same as GNU_FORMAT. Fixes bug
reported by TAMUKI Shoichi <tamuki@linet.gr.jp>, which caused
equivalent `tar cf ...' and `tar rf ...' commands to produce
different archives.

src/create.c

index eb528be25626e9db921a1012ed5608821888a51a..827342794151553a3dc5214d021c8624036b1230 100644 (file)
@@ -152,8 +152,13 @@ to_chars_subst (int negative, int gnu_format, uintmax_t value, size_t valsize,
     {
       int negsub;
       uintmax_t sub = substitute (&negsub) & maxval;
-      /* FIXME: This is the only place where GNU_FORMAT differs from
-        OLDGNU_FORMAT. Apart from this they are completely identical. */
+      /* NOTE: This is one of the few places where GNU_FORMAT differs from
+        OLDGNU_FORMAT.  The actual differences are:
+
+        1. In OLDGNU_FORMAT all strings in a tar header end in \0
+        2. Incremental archives use oldgnu_header.
+        
+        Apart from this they are completely identical. */
       uintmax_t s = (negsub &= archive_format == GNU_FORMAT) ? - sub : sub;
       char subbuf[UINTMAX_STRSIZE_BOUND + 1];
       char *sub_string = STRINGIFY_BIGINT (s, subbuf + 1);
@@ -291,7 +296,8 @@ mode_to_chars (mode_t v, char *p, size_t s)
       && S_IROTH == TOREAD && S_IWOTH == TOWRITE && S_IXOTH == TOEXEC
       && archive_format != POSIX_FORMAT
       && archive_format != USTAR_FORMAT
-      && archive_format != GNU_FORMAT)
+      && archive_format != GNU_FORMAT
+      && archive_format != OLDGNU_FORMAT)
     {
       negative = v < 0;
       u = v;
This page took 0.025862 seconds and 4 git commands to generate.