--- a/gplate/gplate-template.c Sun Jan 20 11:33:03 2008 -0600
+++ b/gplate/gplate-template.c Sun Jan 20 11:34:38 2008 -0600
@@ -194,13 +194,18 @@
gplate_template_update_pattern_helper(gpointer k, gpointer v, gpointer d) {
+ GPlateTemplateTagInfo *info = (GPlateTemplateTagInfo *)v; GString *str = (GString *)d;
- gchar *pattern = (gchar *)v;
+ /* don't add fall through tags to the regex */ + if(!info->prefix || !info->suffix) - g_string_append_printf(str, "|%s", pattern);
- g_string_append_printf(str, "%s", pattern);
+ g_string_append_printf(str, "%s%s.*?%s", sep, info->prefix, info->suffix); @@ -229,8 +234,8 @@
GPlateTemplateTagInfo *info = (GPlateTemplateTagInfo *)v;
- /* if our tag info doesn't have a prefix and a suffix, we drop out. */
- if(!info->prefix && !info->suffix)
+ /* if our tag info doesn't have a prefix or a suffix, we drop out. */ + if(!info->prefix || !info->suffix) /* create our pattern string */
@@ -329,10 +334,13 @@
contents = g_match_info_fetch(match, 1);
g_match_info_free(match);
@@ -517,7 +525,9 @@
gplate_template_render(GPlateTemplate *tplate, const gchar *tplate_string,
+ GList *tokens = NULL, *l = NULL; g_return_val_if_fail(GPLATE_IS_TEMPLATE(tplate), NULL);
g_return_val_if_fail(tplate_string, NULL);
@@ -526,7 +536,24 @@
+ /* for whatever reason, using g_string_new_len here doesn't work */ + str = g_string_new(""); + for(l = tokens; l; l = l->next) { + GPlateTag *tag = GPLATE_TAG(l->data); + gchar *contents = gplate_tag_render(tag, GPLATE_COLLECTION(tplate)); + g_string_append_printf(str, "%s", contents); + g_string_free(str, FALSE);