]> granicus.if.org Git - file/commitdiff
Minor reformatting and commentary changes.
authorIan Darwin <ian@darwinsys.com>
Wed, 16 Sep 1987 10:07:36 +0000 (10:07 +0000)
committerIan Darwin <ian@darwinsys.com>
Wed, 16 Sep 1987 10:07:36 +0000 (10:07 +0000)
src/is_tar.c

index 31b949994e1ba849fe2505acd7f3f35723e4a407..e0c32d7f97450580f6bfbc7e298cad737d5fd9a3 100644 (file)
@@ -2,10 +2,14 @@
  * is_tar() -- figure out whether file is a tar archive.
  *
  * Stolen (by the author!) from the public domain tar program:
- * Pubic Domain version written 26 Aug 1985 by John Gilmore (ihnp4!hoptoad!gnu).
+ * Pubic Domain version written 26 Aug 1985 John Gilmore (ihnp4!hoptoad!gnu).
  *
  * @(#)list.c 1.18 9/23/86 Public Domain - gnu
+ *
+ * Comments changed and some code/comments reformatted
+ * for file command by Ian Darwin.
  */
+
 #include <ctype.h>
 #include <sys/types.h>
 #include "tar.h"
 long from_oct();                       /* Decode octal number */
 
 /*
- * Return 1 for old tar file, 0 if the checksum is bad, 2 for Unix Std tar file.
+ * Return 
+ *     0 if the checksum is bad (i.e., probably not a tar archive), 
+ *     1 for old UNIX tar file,
+ *     2 for Unix Std (POSIX) tar file.
  */
 int
 is_tar(header)
@@ -42,7 +49,8 @@ is_tar(header)
                sum -= 0xFF & header->header.chksum[i];
        sum += ' '* sizeof header->header.chksum;       
 
-       if (sum != recsum) return 0;    /* Not a tar archive */
+       if (sum != recsum)
+               return 0;       /* Not a tar archive */
        
        if (0==strcmp(header->header.magic, TMAGIC)) 
                return 2;               /* Unix Standard tar archive */