Issue #8833: tarfile created hard link entries with a size
field != 0 by mistake. The associated testcase did not
expose this bug because it was broken too.
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
index 4b03c28..a54b3b8 100644
--- a/Lib/tarfile.py
+++ b/Lib/tarfile.py
@@ -1884,7 +1884,7 @@
         tarinfo.mode = stmd
         tarinfo.uid = statres.st_uid
         tarinfo.gid = statres.st_gid
-        if stat.S_ISREG(stmd):
+        if type == REGTYPE:
             tarinfo.size = statres.st_size
         else:
             tarinfo.size = 0L