cvs: /php3/functions basic_functions.c datetime.c
| From: | Jouni Ahto | Date: | Thu, 07 Oct 1999 23:00:46 +0000 |
| Subject: | cvs: /php3/functions basic_functions.c datetime.c | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-11616@lists.php.net to get a copy of this message | ||
jah Thu Oct 7 19:00:46 1999 EDT
Modified files:
/php3/functions basic_functions.c datetime.c
Log:
Locale should now be restored the correct way on request shutdown if it was
changed. Also gmmktime() now behaves the way that seems most correct to me.
Didn't got any comments to my message on the list yesterday.
Index: php3/functions/basic_functions.c
diff -u php3/functions/basic_functions.c:1.279 php3/functions/basic_functions.c:1.280
--- php3/functions/basic_functions.c:1.279 Thu Oct 7 18:16:58 1999
+++ php3/functions/basic_functions.c Thu Oct 7 19:00:44 1999
@@ -28,7 +28,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: basic_functions.c,v 1.279 1999/10/07 22:16:58 jah Exp $ */
+/* $Id: basic_functions.c,v 1.280 1999/10/07 23:00:44 jah Exp $ */
#ifdef THREAD_SAFE
#include "tls.h"
#endif
@@ -423,14 +423,15 @@
{
TLS_VARS;
STR_FREE(GLOBAL(strtok_string));
- /* Check if locale was set and not returned to C */
- if (GLOBAL(locale_string) != "C" || GLOBAL(locale_string) != NULL) {
- setlocale(LC_ALL, "C");
- }
- STR_FREE(GLOBAL(locale_string));
#if HAVE_PUTENV
_php3_hash_destroy(&putenv_ht);
#endif
+ /* Check if locale was changed and change it back
+ to the value in startup environment */
+ if (GLOBAL(locale_string) != NULL) {
+ setlocale(LC_ALL, "");
+ }
+ STR_FREE(GLOBAL(locale_string));
return SUCCESS;
}
Index: php3/functions/datetime.c
diff -u php3/functions/datetime.c:1.75 php3/functions/datetime.c:1.76
--- php3/functions/datetime.c:1.75 Wed Oct 6 03:46:45 1999
+++ php3/functions/datetime.c Thu Oct 7 19:00:44 1999
@@ -30,7 +30,7 @@
*/
-/* $Id: datetime.c,v 1.75 1999/10/06 07:46:45 jah Exp $ */
+/* $Id: datetime.c,v 1.76 1999/10/07 23:00:44 jah Exp $ */
#ifdef THREAD_SAFE
@@ -116,11 +116,7 @@
#if HAVE_TZSET
tzset();
#endif
- if (gm) { /* Fix #2 */
- ta = gmtime(&t); /* Fix #2 */
- } else { /* Fix #2 */
ta = localtime(&t);
- } /* Fix #2 */
/* Let the system decide later whether the time is
in daylight savings time or not. Unless the user