diff options
author | Brent Smith <bmsmith@src.gnome.org> | 2006-05-27 02:05:57 +0000 |
---|---|---|
committer | Brent Smith <bmsmith@src.gnome.org> | 2006-05-27 02:05:57 +0000 |
commit | 72c3f589b6d0421225b3e072e9ad1d2fdf3d6b6f (patch) | |
tree | 1c7cd745a789e22f17a05a4fbd466bfdff2ceaae | |
parent | 69106cc3ca263914c1cc6035ad5baabefea0da73 (diff) | |
download | yelp-72c3f589b6d0421225b3e072e9ad1d2fdf3d6b6f.tar.gz |
don't increment ptr, fixes #341827 - Don Scorgie get rid of pointless
* src/yelp-man-parser.c: (parser_append_given_text_handle_escapes):
don't increment ptr, fixes #341827 - Don Scorgie
* src/yelp-search-pager.c:
get rid of pointless YelpListing type
* src/yelp-toc-pager.c: (process_mandir_pending),
(process_cleanup), (xslt_yelp_document):
Need to allocate memory for encoding b/c xmlFreeDoc tries to free
this
cleanup the man_secthash hash table when finished
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | src/yelp-man-parser.c | 2 | ||||
-rw-r--r-- | src/yelp-search-pager.c | 12 | ||||
-rw-r--r-- | src/yelp-toc-pager.c | 22 |
4 files changed, 21 insertions, 27 deletions
@@ -1,3 +1,15 @@ +2006-05-26 Brent Smith <gnome@nextreality.net> + + * src/yelp-man-parser.c: (parser_append_given_text_handle_escapes): + don't increment ptr, fixes #341827 - Don Scorgie + * src/yelp-search-pager.c: + get rid of pointless YelpListing type + * src/yelp-toc-pager.c: (process_mandir_pending), + (process_cleanup), (xslt_yelp_document): + Need to allocate memory for encoding b/c xmlFreeDoc tries to free + this + cleanup the man_secthash hash table when finished + 2006-05-26 Don Scorgie <dscorgie@cvs.gnome.org> * src/yelp-toc-pager.c: diff --git a/src/yelp-man-parser.c b/src/yelp-man-parser.c index 644e406d..1717f4dc 100644 --- a/src/yelp-man-parser.c +++ b/src/yelp-man-parser.c @@ -1442,7 +1442,7 @@ parser_append_given_text_handle_escapes (YelpManParser *parser, gchar *text, gbo g_free (str); } - anc = ++ptr; + anc = ptr; break; case 'e': anc = ++ptr; diff --git a/src/yelp-search-pager.c b/src/yelp-search-pager.c index 0666cabd..05a53140 100644 --- a/src/yelp-search-pager.c +++ b/src/yelp-search-pager.c @@ -67,8 +67,6 @@ typedef gboolean (*ProcessFunction) (YelpSearchPager *pager); -typedef struct _YelpListing YelpListing; - typedef struct _SearchContainer SearchContainer; #define YELP_SEARCH_PAGER_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), YELP_TYPE_SEARCH_PAGER, YelpSearchPagerPriv)) @@ -89,16 +87,6 @@ struct _YelpSearchPagerPriv { GSList * pending_searches; }; -struct _YelpListing { - gchar *id; - gchar *title; - - GSList *listings; - GSList *documents; - - gboolean has_listings; -}; - enum { NOT_SEARCHING = 0, SEARCH_1, diff --git a/src/yelp-toc-pager.c b/src/yelp-toc-pager.c index 2013f036..5b345728 100644 --- a/src/yelp-toc-pager.c +++ b/src/yelp-toc-pager.c @@ -65,8 +65,6 @@ typedef gboolean (*ProcessFunction) (YelpTocPager *pager); -typedef struct _YelpListing YelpListing; - #define YELP_TOC_PAGER_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), YELP_TYPE_TOC_PAGER, YelpTocPagerPriv)) struct _YelpTocPagerPriv { @@ -107,16 +105,6 @@ struct _YelpTocPagerPriv { xsltTransformContextPtr transformContext; }; -struct _YelpListing { - gchar *id; - gchar *title; - - GSList *listings; - GSList *documents; - - gboolean has_listings; -}; - static void toc_pager_class_init (YelpTocPagerClass *klass); static void toc_pager_init (YelpTocPager *pager); static void toc_pager_dispose (GObject *gobject); @@ -1216,7 +1204,7 @@ process_mandir_pending (YelpTocPager *pager) XML_PARSE_NOBLANKS | XML_PARSE_NOCDATA | XML_PARSE_NOENT | XML_PARSE_NOERROR | XML_PARSE_NONET ); - priv->man_secthash = g_hash_table_new (g_str_hash, g_str_equal); + priv->man_secthash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); xpath = xmlXPathNewContext (priv->toc_doc); obj = xmlXPathEvalExpression (BAD_CAST "//toc", xpath); @@ -1801,6 +1789,12 @@ process_cleanup (YelpTocPager *pager) { YelpTocPagerPriv *priv = pager->priv; + /* clean up the man page section hash table */ + if (priv->man_secthash) { + g_hash_table_destroy (priv->man_secthash); + priv->man_secthash = NULL; + } + /* cleanup the stylesheet used to process the toc */ if (priv->stylesheet) { xsltFreeStylesheet (priv->stylesheet); @@ -1926,7 +1920,7 @@ xslt_yelp_document (xsltTransformContextPtr ctxt, new_doc->intSubset = dtd; new_doc->extSubset = dtd; new_doc->charset = XML_CHAR_ENCODING_UTF8; - new_doc->encoding = BAD_CAST "utf-8"; + new_doc->encoding = xmlStrdup (BAD_CAST "utf-8"); new_doc->dict = ctxt->dict; xmlDictReference (new_doc->dict); |