summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrent Smith <bmsmith@src.gnome.org>2006-04-23 23:12:12 +0000
committerBrent Smith <bmsmith@src.gnome.org>2006-04-23 23:12:12 +0000
commitb75704d6974c542d1627b71620408620fc3f3d56 (patch)
treef615e834b904bb4933f0e2614413f9bb4717d860
parent314429bc3f81993bbb76dae3d26b2dd7e4582182 (diff)
downloadyelp-b75704d6974c542d1627b71620408620fc3f3d56.tar.gz
Only write a mansect element when we have a non empty linked list of
* src/yelp-toc-pager.c: (process_mandir_pending): Only write a mansect element when we have a non empty linked list of directories
-rw-r--r--ChangeLog6
-rw-r--r--src/yelp-toc-pager.c20
2 files changed, 17 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index a0d93ac3..555170be 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2006-04-23 Brent Smith <gnome@nextreality.net>
+ * src/yelp-toc-pager.c: (process_mandir_pending):
+ Only write a mansect element when we have a non empty linked list of
+ directories
+
+2006-04-23 Brent Smith <gnome@nextreality.net>
+
* configure.in:
Don't print out whether or not beagle is available in the summary
since there are instances where we don't even check, i.e.
diff --git a/src/yelp-toc-pager.c b/src/yelp-toc-pager.c
index d3c54a38..1d4187f7 100644
--- a/src/yelp-toc-pager.c
+++ b/src/yelp-toc-pager.c
@@ -1247,7 +1247,7 @@ process_mandir_pending (YelpTocPager *pager)
/* check for the existence of the xml cache file in ~/.gnome2/yelp.d/
* if it exists, use it as the source for man pages instead of
* searching the hard disk for them - should make startup much faster */
- if (g_file_test (index_file, G_FILE_TEST_EXISTS) &&
+ if (g_file_test (index_file, G_FILE_TEST_IS_REGULAR) &&
create_toc_from_index (pager, index_file)) {
/* we are done processing, return FALSE so we don't call this
@@ -1305,14 +1305,6 @@ process_mandir_pending (YelpTocPager *pager)
/* iterate through our previously created linked lists and create the
* table of contents from them */
- if (!priv->man_manhash) {
- priv->man_manhash = g_hash_table_new_full (g_str_hash, g_str_equal,
- g_free, NULL);
-
- priv->ins = xmlNewChild (priv->root, NULL, BAD_CAST "mansect", NULL);
- xmlAddChild (priv->ins, xmlNewText (BAD_CAST "\n "));
- }
-
if (priv->mandir_langpath && priv->mandir_langpath->data) {
dirname = priv->mandir_langpath->data;
@@ -1323,6 +1315,16 @@ process_mandir_pending (YelpTocPager *pager)
if (g_stat (dirname, &buf) < 0)
g_warning ("Unable to stat dir: \"%s\"\n", dirname);
+ /* check to see if we need create a new hash table */
+ if (!priv->man_manhash) {
+ priv->man_manhash =
+ g_hash_table_new_full (g_str_hash, g_str_equal,
+ g_free, NULL);
+
+ priv->ins = xmlNewChild (priv->root, NULL, BAD_CAST "mansect", NULL);
+ xmlAddChild (priv->ins, xmlNewText (BAD_CAST "\n "));
+ }
+
g_snprintf (mtime_str, 20, "%u", (guint) buf.st_mtime);
priv->ins = xmlNewChild (priv->ins, NULL, BAD_CAST "dir", NULL);