cvs: php-src(PHP_5_2) /ext/mime_magic mime_magic.c

From: Date: Thu, 30 Nov 2006 15:13:20 +0000
Subject: cvs: php-src(PHP_5_2) /ext/mime_magic mime_magic.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-41785@lists.php.net to get a copy of this message
iliaa Thu Nov 30 15:13:20 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/mime_magic mime_magic.c Log: Use thread-safe code http://cvs.php.net/viewvc.cgi/php-src/ext/mime_magic/mime_magic.c?r1=1.42.2.5.2.2&r2=1.42.2.5.2.3&diff_format=u Index: php-src/ext/mime_magic/mime_magic.c diff -u php-src/ext/mime_magic/mime_magic.c:1.42.2.5.2.2 php-src/ext/mime_magic/mime_magic.c:1.42.2.5.2.3 --- php-src/ext/mime_magic/mime_magic.c:1.42.2.5.2.2 Sun Nov 26 17:02:13 2006 +++ php-src/ext/mime_magic/mime_magic.c Thu Nov 30 15:13:19 2006 @@ -15,7 +15,7 @@ | Author: Hartmut Holzgraefe <hholzgra@php.net> | +----------------------------------------------------------------------+ - $Id: mime_magic.c,v 1.42.2.5.2.2 2006/11/26 17:02:13 iliaa Exp $ + $Id: mime_magic.c,v 1.42.2.5.2.3 2006/11/30 15:13:19 iliaa Exp $ This module contains a lot of stuff taken from Apache mod_mime_magic, so the license section is a little bit longer than usual: @@ -1755,12 +1755,15 @@ case DATE: case BEDATE: case LEDATE: - /* XXX: not multithread safe */ - pp = ctime((time_t *) & p->l); - if ((rt = strchr(pp, '\n')) != NULL) - *rt = '\0'; - (void) magic_rsl_printf(m->desc, pp); - return; + { + char ctimebuf[52]; + pp = php_ctime_r((time_t *) &p->l, ctimebuf); + if ((rt = strchr(pp, '\n')) != NULL) { + *rt = '\0'; + } + (void) magic_rsl_printf(m->desc, pp); + return; + } default: { TSRMLS_FETCH();

« previous php.cvs (#41785) next »