--- tzcode2001c/strftime.c Tue Jun 5 13:49:50 2001 +++ tzcode2001c-Sun5/strftime.c Thu Jun 14 14:27:35 2001 @@ -604,6 +604,7 @@ static const char lc_time[] = "LC_TIME"; static char * locale_buf; static char locale_buf_C[] = "C"; + static int cache_good; int fd; int oldsun; /* "...ain't got nothin' to do..." */ @@ -629,7 +630,7 @@ ** If the locale name is the same as our cache, use the cache. */ lbuf = locale_buf; - if (lbuf != NULL && strcmp(name, lbuf) == 0) { + if (cache_good && lbuf != NULL && strcmp(name, lbuf) == 0) { p = lbuf; for (ap = (const char **) &localebuf; ap < (const char **) (&localebuf + 1); @@ -705,6 +706,7 @@ ** Record the successful parse in the cache. */ locale_buf = lbuf; + cache_good = 1; return &localebuf; @@ -715,6 +717,7 @@ no_locale: localebuf = C_time_locale; locale_buf = locale_buf_C; + cache_good = 0; return &localebuf; } #endif /* defined LOCALE_HOME */