From e02079098fc5c9ab1ccea21abf2faf2a90101a80 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Tue, 15 Dec 1998 18:50:53 +0000 Subject: [PATCH] Solaris has a broken strftime that produced garbage output for the test 1998-12-15 Havoc Pennington * gdate.c (g_date_prepare_to_parse): Solaris has a broken strftime that produced garbage output for the test date I was using to set up the parser. So use a different date that Solaris seems to like. --- ChangeLog | 7 +++++++ ChangeLog.pre-2-0 | 7 +++++++ ChangeLog.pre-2-10 | 7 +++++++ ChangeLog.pre-2-12 | 7 +++++++ ChangeLog.pre-2-2 | 7 +++++++ ChangeLog.pre-2-4 | 7 +++++++ ChangeLog.pre-2-6 | 7 +++++++ ChangeLog.pre-2-8 | 7 +++++++ gdate.c | 6 ++++-- glib/gdate.c | 6 ++++-- 10 files changed, 64 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 29cf2ba37..05f3caf13 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +1998-12-15 Havoc Pennington + + * gdate.c (g_date_prepare_to_parse): Solaris has a broken strftime + that produced garbage output for the test date I was using to + set up the parser. So use a different date that Solaris seems + to like. + 1998-12-15 Sebastian Wilhelmi * configure.in: Dont complain, if --without-threads or diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 29cf2ba37..05f3caf13 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,10 @@ +1998-12-15 Havoc Pennington + + * gdate.c (g_date_prepare_to_parse): Solaris has a broken strftime + that produced garbage output for the test date I was using to + set up the parser. So use a different date that Solaris seems + to like. + 1998-12-15 Sebastian Wilhelmi * configure.in: Dont complain, if --without-threads or diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 29cf2ba37..05f3caf13 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,10 @@ +1998-12-15 Havoc Pennington + + * gdate.c (g_date_prepare_to_parse): Solaris has a broken strftime + that produced garbage output for the test date I was using to + set up the parser. So use a different date that Solaris seems + to like. + 1998-12-15 Sebastian Wilhelmi * configure.in: Dont complain, if --without-threads or diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 29cf2ba37..05f3caf13 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,10 @@ +1998-12-15 Havoc Pennington + + * gdate.c (g_date_prepare_to_parse): Solaris has a broken strftime + that produced garbage output for the test date I was using to + set up the parser. So use a different date that Solaris seems + to like. + 1998-12-15 Sebastian Wilhelmi * configure.in: Dont complain, if --without-threads or diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 29cf2ba37..05f3caf13 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,10 @@ +1998-12-15 Havoc Pennington + + * gdate.c (g_date_prepare_to_parse): Solaris has a broken strftime + that produced garbage output for the test date I was using to + set up the parser. So use a different date that Solaris seems + to like. + 1998-12-15 Sebastian Wilhelmi * configure.in: Dont complain, if --without-threads or diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 29cf2ba37..05f3caf13 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,10 @@ +1998-12-15 Havoc Pennington + + * gdate.c (g_date_prepare_to_parse): Solaris has a broken strftime + that produced garbage output for the test date I was using to + set up the parser. So use a different date that Solaris seems + to like. + 1998-12-15 Sebastian Wilhelmi * configure.in: Dont complain, if --without-threads or diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 29cf2ba37..05f3caf13 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,10 @@ +1998-12-15 Havoc Pennington + + * gdate.c (g_date_prepare_to_parse): Solaris has a broken strftime + that produced garbage output for the test date I was using to + set up the parser. So use a different date that Solaris seems + to like. + 1998-12-15 Sebastian Wilhelmi * configure.in: Dont complain, if --without-threads or diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 29cf2ba37..05f3caf13 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,10 @@ +1998-12-15 Havoc Pennington + + * gdate.c (g_date_prepare_to_parse): Solaris has a broken strftime + that produced garbage output for the test date I was using to + set up the parser. So use a different date that Solaris seems + to like. + 1998-12-15 Sebastian Wilhelmi * configure.in: Dont complain, if --without-threads or diff --git a/gdate.c b/gdate.c index 7c60e23d9..667243697 100644 --- a/gdate.c +++ b/gdate.c @@ -566,7 +566,9 @@ g_date_prepare_to_parse (const gchar *str, GDateParseTokens *pt) /* Determine DMY order */ - g_date_set_dmy (&d, 4, 7, 1776); /* had to pick a random day */ + /* had to pick a random day - don't change this, some strftimes + * are broken on some days, and this one is good so far. */ + g_date_set_dmy (&d, 4, 7, 1976); g_date_strftime (buf, 127, "%x", &d); @@ -585,7 +587,7 @@ g_date_prepare_to_parse (const gchar *str, GDateParseTokens *pt) break; case 76: using_twodigit_years = TRUE; /* FALL THRU */ - case 1776: + case 1976: dmy_order[i] = G_DATE_YEAR; break; default: diff --git a/glib/gdate.c b/glib/gdate.c index 7c60e23d9..667243697 100644 --- a/glib/gdate.c +++ b/glib/gdate.c @@ -566,7 +566,9 @@ g_date_prepare_to_parse (const gchar *str, GDateParseTokens *pt) /* Determine DMY order */ - g_date_set_dmy (&d, 4, 7, 1776); /* had to pick a random day */ + /* had to pick a random day - don't change this, some strftimes + * are broken on some days, and this one is good so far. */ + g_date_set_dmy (&d, 4, 7, 1976); g_date_strftime (buf, 127, "%x", &d); @@ -585,7 +587,7 @@ g_date_prepare_to_parse (const gchar *str, GDateParseTokens *pt) break; case 76: using_twodigit_years = TRUE; /* FALL THRU */ - case 1776: + case 1976: dmy_order[i] = G_DATE_YEAR; break; default: -- 2.34.1