From: Mikael Magnusson Date: Sun, 11 Aug 2013 13:17:51 +0000 (+0200) Subject: regextype X-Git-Tag: mikabox-3.5-7~20 X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=992b39b015a0562804bcfb62f128990b7665b1b0;p=mikachu%2Fopenbox.git regextype --- 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); } }