cvs: php-src /ext/mime_magic mime_magic.c

From: Date: Thu, 30 Nov 2006 15:13:33 +0000
Subject: cvs: php-src /ext/mime_magic mime_magic.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-41786@lists.php.net to get a copy of this message
iliaa Thu Nov 30 15:13:33 2006 UTC Modified files: /php-src/ext/mime_magic mime_magic.c Log: MFB: Use thread-safe code http://cvs.php.net/viewvc.cgi/php-src/ext/mime_magic/mime_magic.c?r1=1.51&r2=1.52&diff_format=u Index: php-src/ext/mime_magic/mime_magic.c diff -u php-src/ext/mime_magic/mime_magic.c:1.51 php-src/ext/mime_magic/mime_magic.c:1.52 --- php-src/ext/mime_magic/mime_magic.c:1.51 Sun Nov 26 17:03:15 2006 +++ php-src/ext/mime_magic/mime_magic.c Thu Nov 30 15:13:33 2006 @@ -15,7 +15,7 @@ | Author: Hartmut Holzgraefe <hholzgra@php.net> | +----------------------------------------------------------------------+ - $Id: mime_magic.c,v 1.51 2006/11/26 17:03:15 iliaa Exp $ + $Id: mime_magic.c,v 1.52 2006/11/30 15:13:33 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 (#41786) next »