CVS update: php4/ext/standard
| From: | sas | Date: | Sun, 27 Jun 1999 21:45:08 +0000 |
| Subject: | CVS update: php4/ext/standard | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-1702@lists.php.net to get a copy of this message | ||
Date: Sunday June 27, 1999 @ 17:45
Author: sas
Update of /repository/php4/ext/standard
In directory php:/tmp/cvs-serv2672/ext/standard
Modified Files:
base64.c datetime.c file.c
Log Message:
more porting
Index: php4/ext/standard/base64.c
diff -u php4/ext/standard/base64.c:1.4 php4/ext/standard/base64.c:1.5
--- php4/ext/standard/base64.c:1.4 Sun May 16 07:19:25 1999
+++ php4/ext/standard/base64.c Sun Jun 27 17:45:06 1999
@@ -26,7 +26,7 @@
| Author: Jim Winstead (jimw@php.net) |
+----------------------------------------------------------------------+
*/
-/* $Id: base64.c,v 1.4 1999/05/16 11:19:25 sas Exp $ */
+/* $Id: base64.c,v 1.5 1999/06/27 21:45:06 sas Exp $ */
#include <string.h>
@@ -92,10 +92,7 @@
while ((ch = *current++) != '\0') {
if (ch == base64_pad) break;
ch = (int)strchr(base64_table, ch);
- if (ch == 0) {
- efree(result);
- return NULL;
- }
+ if (ch == 0) continue;
ch -= (int)base64_table;
switch(i % 4) {
Index: php4/ext/standard/datetime.c
diff -u php4/ext/standard/datetime.c:1.8 php4/ext/standard/datetime.c:1.9
--- php4/ext/standard/datetime.c:1.8 Tue Jun 15 08:31:29 1999
+++ php4/ext/standard/datetime.c Sun Jun 27 17:45:06 1999
@@ -30,7 +30,7 @@
*/
-/* $Id: datetime.c,v 1.8 1999/06/15 12:31:29 rasmus Exp $ */
+/* $Id: datetime.c,v 1.9 1999/06/27 21:45:06 sas Exp $ */
#include "php.h"
@@ -79,12 +79,12 @@
void _php3_mktime(INTERNAL_FUNCTION_PARAMETERS, int gm)
{
- pval *arguments[6];
+ pval *arguments[7];
struct tm ta, *tn;
time_t t;
int i, gmadjust=0,arg_count = ARG_COUNT(ht);
- if (arg_count > 6 || getParametersArray(ht, arg_count, arguments) == FAILURE) {
+ if (arg_count > 7 || getParametersArray(ht, arg_count, arguments) == FAILURE) {
WRONG_PARAM_COUNT;
}
/* convert supplied arguments to longs */
@@ -92,14 +92,15 @@
convert_to_long(arguments[i]);
}
t=time(NULL);
-#if HAVE_TZSET
+#ifdef HAVE_TZSET
tzset();
#endif
tn = localtime(&t);
memcpy(&ta,tn,sizeof(struct tm));
- ta.tm_isdst = -1;
+ ta.tm_isdst = arg_count > 6 ? arguments[6]->value.lval : gm ? 0 : -1;
switch(arg_count) {
+ case 7:
case 6:
ta.tm_year = arguments[5]->value.lval - ((arguments[5]->value.lval > 1000) ? 1900 : 0);
/* fall-through */
@@ -125,15 +126,15 @@
if (gm) {
#if HAVE_TM_GMTOFF
- gmadjust=(tn->tm_gmtoff)/3600;
+ gmadjust=tn->tm_gmtoff;
#else
- gmadjust=timezone/3600;
+ gmadjust=timezone;
#endif
+ ta.tm_hour += gmadjust / 3600;
+ ta.tm_min += gmadjust % 3600;
}
- ta.tm_hour+=gmadjust;
- return_value->value.lval = mktime(&ta);
- return_value->type = IS_LONG;
+ RETURN_LONG(mktime(&ta));
}
PHP_FUNCTION(mktime)
Index: php4/ext/standard/file.c
diff -u php4/ext/standard/file.c:1.18 php4/ext/standard/file.c:1.19
--- php4/ext/standard/file.c:1.18 Wed Jun 16 13:06:51 1999
+++ php4/ext/standard/file.c Sun Jun 27 17:45:06 1999
@@ -27,7 +27,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: file.c,v 1.18 1999/06/16 17:06:51 ssb Exp $ */
+/* $Id: file.c,v 1.19 1999/06/27 21:45:06 sas Exp $ */
/* Synced with php3 revision 1.218 1999-06-16 [ssb] */
@@ -535,6 +535,9 @@
t = tempnam(d,p);
efree(d);
+ if(!t) {
+ RETURN_FALSE;
+ }
RETURN_STRING(t,1);
}
/* }}} */