cvs: php4(PHP_4_2_0) /ext/standard filestat.c

From: Date: Mon, 29 Apr 2002 09:43:49 +0000
Subject: cvs: php4(PHP_4_2_0) /ext/standard filestat.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-11519@lists.php.net to get a copy of this message
yohgaki Mon Apr 29 05:43:49 2002 EDT Modified files: (Branch: PHP_4_2_0) /php4/ext/standard filestat.c Log: MFH touch bag fix Index: php4/ext/standard/filestat.c diff -u php4/ext/standard/filestat.c:1.89 php4/ext/standard/filestat.c:1.89.2.1 --- php4/ext/standard/filestat.c:1.89 Thu Feb 28 03:26:45 2002 +++ php4/ext/standard/filestat.c Mon Apr 29 05:43:48 2002 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: filestat.c,v 1.89 2002/02/28 08:26:45 sebastian Exp $ */ +/* $Id: filestat.c,v 1.89.2.1 2002/04/29 09:43:48 yohgaki Exp $ */ #include "php.h" #include "safe_mode.h" @@ -475,7 +475,7 @@ struct stat sb; FILE *file; struct utimbuf newtimebuf; - struct utimbuf *newtime = &newtimebuf; + struct utimbuf *newtime = NULL; int ac = ZEND_NUM_ARGS(); if (ac == 1 && zend_get_parameters_ex(1, &filename) != FAILURE) { @@ -483,9 +483,12 @@ newtime->modtime = newtime->actime = time(NULL); #endif } else if (ac == 2 && zend_get_parameters_ex(2, &filename, &filetime) != FAILURE) { + newtime = &newtimebuf; convert_to_long_ex(filetime); + newtime->actime = time(NULL); newtime->modtime = newtime->actime = Z_LVAL_PP(filetime); } else if (ac == 3 && zend_get_parameters_ex(3, &filename, &filetime, &fileatime) != FAILURE) { + newtime = &newtimebuf; convert_to_long_ex(fileatime); convert_to_long_ex(filetime); newtime->actime = Z_LVAL_PP(fileatime); @@ -519,9 +522,8 @@ if (ret == -1) { php_error(E_WARNING, "utime failed: %s", strerror(errno)); RETURN_FALSE; - } else { - RETURN_TRUE; } + RETURN_TRUE; #endif } /* }}} */

« previous php.cvs (#11519) next »