[21/59] Document assumption that NO_DST == 0

Message ID 20250105055750.1668721-22-eggert@cs.ucla.edu (mailing list archive)
State New
Headers
Series time: sync mktime from Gnulib |

Checks

Context Check Description
redhat-pt-bot/TryBot-apply_patch success Patch applied to master at the time it was sent

Commit Message

Paul Eggert Jan. 5, 2025, 5:56 a.m. UTC
  * time/tzset.c (__tzset_parse_tz): Document assumption that
NO_DST is zero here, just as it is already documentted in
tzset_internal.  This does not change the generated code
when optimizing.
---
 time/tzset.c | 2 ++
 1 file changed, 2 insertions(+)
  

Patch

diff --git a/time/tzset.c b/time/tzset.c
index e001a5898c..a198b180eb 100644
--- a/time/tzset.c
+++ b/time/tzset.c
@@ -354,6 +354,8 @@  __tzset_parse_tz (const char *tz)
 {
   /* Clear out old state and reset to unnamed UTC.  */
   memset (tz_rules, '\0', sizeof tz_rules);
+  if (NO_DST != 0)
+    tz_rules[0].type = tz_rules[1].type = NO_DST;
   tz_rules[0].name = tz_rules[1].name = "";
 
   /* Get the standard time zone abbreviations.  */