]> git.cworth.org Git - tar/blobdiff - lib/mktime.c
Imported Upstream version 1.21
[tar] / lib / mktime.c
index 045f7d2d5251735df3437401213b76666fbb842d..776a48af3dbd44dae70f9d0d6f302d6fbf15ce65 100644 (file)
@@ -292,7 +292,9 @@ __mktime_internal (struct tm *tp,
   int mday = tp->tm_mday;
   int mon = tp->tm_mon;
   int year_requested = tp->tm_year;
-  int isdst = tp->tm_isdst;
+  /* Normalize the value.  */
+  int isdst = ((tp->tm_isdst >> (8 * sizeof (tp->tm_isdst) - 1))
+              | (tp->tm_isdst != 0));
 
   /* 1 if the previous probe was DST.  */
   int dst2;