strptime patch

tsteven4 tsteven4@gmail.com
Wed Jan 21 17:20:08 GMT 2026


I have attached a patch to fix an issue in strptime with the %a format.  
strptime can fail to recognize names in the ab_weekday_name list when 
_NL_CURRENT is undefined.
-------------- next part --------------
diff --git a/time/strptime_l.c b/time/strptime_l.c
index 8e946f4f64..2fe25d080e 100644
--- a/time/strptime_l.c
+++ b/time/strptime_l.c
@@ -377,7 +377,7 @@ __strptime_internal (const char *rp, const char *fmt, struct tm *tmp,
 	      if (s.decided != loc
 		  && (((trp = rp, match_string (weekday_name[cnt], trp))
 		       && trp > rp_longest)
-		      || ((trp = rp, match_string (ab_weekday_name[cnt], rp))
+		      || ((trp = rp, match_string (ab_weekday_name[cnt], trp))
 			  && trp > rp_longest)))
 		{
 		  rp_longest = trp;


More information about the Libc-alpha mailing list