From 992b39b015a0562804bcfb62f128990b7665b1b0 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sun, 11 Aug 2013 15:17:51 +0200 Subject: [PATCH] regextype --- openbox/actions/if.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/openbox/actions/if.c b/openbox/actions/if.c index dc3a0b44..102cc039 100644 --- a/openbox/actions/if.c +++ b/openbox/actions/if.c @@ -105,16 +105,14 @@ static gpointer setup_func(xmlNodePtr node) } } if ((n = obt_xml_find_node(node, "title"))) { - gchar *s; - if ((s = obt_xml_node_string(n))) { - o->matchtitle = g_pattern_spec_new(s); - g_free(s); - } - } - if ((n = obt_xml_find_node(node, "regextitle"))) { - gchar *s; + gchar *s, *type = NULL; if ((s = obt_xml_node_string(n))) { - o->regextitle = g_regex_new(s, 0, 0, NULL); + if (!obt_xml_attr_string(n, "type", &type) || + !g_ascii_strcasecmp(type, "pattern")) + { + o->matchtitle = g_pattern_spec_new(s); + } else if (type && !g_ascii_strcasecmp(type, "regex")) + o->regextitle = g_regex_new(s, 0, 0, NULL); g_free(s); } } -- 2.34.1