Re: cvs: php4 /ext/gd/ gdttf.c

From: Date: Mon, 12 Jun 2000 19:28:46 +0000
Subject: Re: cvs: php4 /ext/gd/ gdttf.c
References: 1  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-196@lists.php.net to get a copy of this message
virtual_filepath() sets the filepath to a malloc()'ed path. You need to free() it later on. Check the swf_openfile() code. I know it's a bit ugly but I can't think of any better way right now. Andi At 07:13 PM 6/12/00 +0000, Andrei Zmievski wrote:
andrei          Mon Jun 12 12:13:21 2000 EDT
Modified files:
    /php4/ext/gd        gdttf.c
Log: Make gdttf.c work with virtual dir support. Index: php4/ext/gd/gdttf.c diff -u php4/ext/gd/gdttf.c:1.7 php4/ext/gd/gdttf.c:1.8
--- php4/ext/gd/gdttf.c:1.7     Tue Feb  8 14:21:43 2000
+++ php4/ext/gd/gdttf.c Mon Jun 12 12:13:21 2000 @@ -2,7 +2,7 @@
 /*                                          */
 /* John Ellson   ellson@lucent.com          */
-/* $Id: gdttf.c,v 1.7 2000/02/08 22:21:43 zeev Exp $ */ +/* $Id: gdttf.c,v 1.8 2000/06/12 19:13:21 andrei Exp $ */ #if WIN32|WINNT #include "config.w32.h" @@ -332,8 +332,15 @@
        short                   platform, encoding;
        a = (font_t *)malloc(sizeof(font_t));
+#ifdef VIRTUAL_DIR
+       if (virtual_filepath(b->fontname, &a->fontname)) {
+               *error = "Could not find/open font";
+               return NULL;
+       }
+#else
        a->fontname = (char *)malloc(strlen(b->fontname) + 1);
        strcpy(a->fontname,b->fontname);
+#endif
        a->ptsize = b->ptsize;
        a->angle = b->angle;
        a->sin_a = sin(a->angle);
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-cvs-unsubscribe@lists.php.net For additional commands, e-mail: php-cvs-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net
--- Andi Gutmans <andi@zend.com> http://www.zend.com/

« previous php.cvs (#196) next »