cvs: pecl /tidy tidy.c
| From: | John Coggeshall | Date: | Mon, 03 Nov 2003 16:35:58 +0000 |
| Subject: | cvs: pecl /tidy tidy.c | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-518@lists.php.net to get a copy of this message | ||
john Mon Nov 3 11:35:58 2003 EDT
Modified files:
/pecl/tidy tidy.c
Log:
Fixed a bug -- Nodes of certain types don't actually have ID values and PHP
would segv trying to read one.
Index: pecl/tidy/tidy.c
diff -u pecl/tidy/tidy.c:1.15 pecl/tidy/tidy.c:1.16
--- pecl/tidy/tidy.c:1.15 Thu Sep 25 05:32:54 2003
+++ pecl/tidy/tidy.c Mon Nov 3 11:35:58 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: tidy.c,v 1.15 2003/09/25 09:32:54 john Exp $ */
+/* $Id: tidy.c,v 1.16 2003/11/03 16:35:58 john Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -985,9 +985,16 @@
ADD_PROPERITY_STRING(obj->std.properties, value, buf.bp);
tidyBufFree(&buf);
+ fprintf(stderr, "type: %d\n",tidyNodeGetType(obj->node));
ADD_PROPERITY_STRING(obj->std.properties, name, tidyNodeGetName(obj->node));
ADD_PROPERITY_LONG(obj->std.properties, type, tidyNodeGetType(obj->node));
- ADD_PROPERITY_LONG(obj->std.properties, id, tidyNodeGetId(obj->node));
+ switch(tidyNodeGetType(obj->node)) {
+ case TidyNode_Text:
+ case TidyNode_Comment:
+ break;
+ default:
+ ADD_PROPERITY_LONG(obj->std.properties, id, tidyNodeGetId(obj->node));
+ }
break;
case is_attr: