From bb58d822fb517f4a7a242994bbda3693255b2c74 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Sun, 12 Dec 2010 18:40:42 +0100 Subject: setup: Code cleanup --- src/xml-parser.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/xml-parser.c') diff --git a/src/xml-parser.c b/src/xml-parser.c index 3eae5b1..84cc204 100644 --- a/src/xml-parser.c +++ b/src/xml-parser.c @@ -152,6 +152,16 @@ xml_file_get_node_value (TXMLFile *file, const gchar *x_path) return val; } +gchar * +xml_file_get_node_value_with_default (TXMLFile *file, const gchar *x_path, const gchar *_default) +{ + gchar *s; + + s = xml_file_get_node_value (file, x_path); + + return s ? s : g_strdup (_default); +} + /* * xml_file_get_node_attribute: retrieve attribute value from XPath node -- cgit v1.2.3