From cc5ab76186b6a1f842eb758a6997c54b1917c885 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Sun, 2 Mar 2014 08:40:17 +0100 Subject: [PATCH] trigger: allow chars '\' and '(' as delimiter in regex --- po/cs.po | 7 +++---- po/de.po | 7 +++---- po/es.po | 7 +++---- po/fr.po | 17 ++++++++--------- po/hu.po | 7 +++---- po/it.po | 7 +++---- po/ja.po | 7 +++---- po/pl.po | 7 +++---- po/pt_BR.po | 7 +++---- po/ru.po | 7 +++---- po/tr.po | 7 +++---- po/weechat.pot | 7 +++---- src/plugins/trigger/trigger-config.c | 6 +++--- src/plugins/trigger/trigger.c | 2 -- 14 files changed, 44 insertions(+), 58 deletions(-) diff --git a/po/cs.po b/po/cs.po index 0269ba981..4f09bccca 100644 --- a/po/cs.po +++ b/po/cs.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-03-02 08:13+0100\n" +"POT-Creation-Date: 2014-03-02 08:35+0100\n" "PO-Revision-Date: 2014-02-20 12:24+0100\n" "Last-Translator: Jiri Golembiovsky \n" "Language-Team: weechat-dev \n" @@ -9987,9 +9987,8 @@ msgid "" "var\" (var is the hashtable variable to replace, it is optional), many regex " "can be separated by a space, for example: \"/regex1/replace1/var1 /regex2/" "replace2/var2\"; the separator \"/\" can be replaced by any char (one or " -"more identical chars), except '\\' and parentheses; matching groups can be " -"used in replace: $0 to $99, $+ for last match and $.cN to replace all chars " -"of group N by char c" +"more identical chars); matching groups can be used in replace: $0 to $99, $+ " +"for last match and $.cN to replace all chars of group N by char c" msgstr "" msgid "" diff --git a/po/de.po b/po/de.po index 215fe13b4..1b13bca2c 100644 --- a/po/de.po +++ b/po/de.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-03-02 08:13+0100\n" +"POT-Creation-Date: 2014-03-02 08:35+0100\n" "PO-Revision-Date: 2014-02-20 12:24+0100\n" "Last-Translator: Nils Görs \n" "Language-Team: German \n" @@ -11128,9 +11128,8 @@ msgid "" "var\" (var is the hashtable variable to replace, it is optional), many regex " "can be separated by a space, for example: \"/regex1/replace1/var1 /regex2/" "replace2/var2\"; the separator \"/\" can be replaced by any char (one or " -"more identical chars), except '\\' and parentheses; matching groups can be " -"used in replace: $0 to $99, $+ for last match and $.cN to replace all chars " -"of group N by char c" +"more identical chars); matching groups can be used in replace: $0 to $99, $+ " +"for last match and $.cN to replace all chars of group N by char c" msgstr "" msgid "" diff --git a/po/es.po b/po/es.po index 52468afac..ab1de7389 100644 --- a/po/es.po +++ b/po/es.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-03-02 08:13+0100\n" +"POT-Creation-Date: 2014-03-02 08:35+0100\n" "PO-Revision-Date: 2014-02-20 12:25+0100\n" "Last-Translator: Elián Hanisch \n" "Language-Team: weechat-dev \n" @@ -10251,9 +10251,8 @@ msgid "" "var\" (var is the hashtable variable to replace, it is optional), many regex " "can be separated by a space, for example: \"/regex1/replace1/var1 /regex2/" "replace2/var2\"; the separator \"/\" can be replaced by any char (one or " -"more identical chars), except '\\' and parentheses; matching groups can be " -"used in replace: $0 to $99, $+ for last match and $.cN to replace all chars " -"of group N by char c" +"more identical chars); matching groups can be used in replace: $0 to $99, $+ " +"for last match and $.cN to replace all chars of group N by char c" msgstr "" msgid "" diff --git a/po/fr.po b/po/fr.po index 0b414d647..6e4c45114 100644 --- a/po/fr.po +++ b/po/fr.po @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-03-02 08:13+0100\n" -"PO-Revision-Date: 2014-03-02 08:15+0100\n" +"POT-Creation-Date: 2014-03-02 08:35+0100\n" +"PO-Revision-Date: 2014-03-02 08:36+0100\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -10951,9 +10951,8 @@ msgid "" "var\" (var is the hashtable variable to replace, it is optional), many regex " "can be separated by a space, for example: \"/regex1/replace1/var1 /regex2/" "replace2/var2\"; the separator \"/\" can be replaced by any char (one or " -"more identical chars), except '\\' and parentheses; matching groups can be " -"used in replace: $0 to $99, $+ for last match and $.cN to replace all chars " -"of group N by char c" +"more identical chars); matching groups can be used in replace: $0 to $99, $+ " +"for last match and $.cN to replace all chars of group N by char c" msgstr "" "remplacer du texte avec une expression régulière POSIX étendue (cela est " "fait seulement si les conditions sont OK, et avant d'exécuter la commande) " @@ -10962,10 +10961,10 @@ msgstr "" "de hachage à remplacer, elle est facultative), plusieurs expressions " "régulières peuvent être séparées par un espace, par exemple: \"/regex1/" "replace1/var1 /regex2/replace2/var2\"; le séparateur \"/\" peut être " -"remplacé par n'importe quel caractère (un ou plusieurs identiques), sauf " -"'\\' et les parenthèses; les groupes de correspondance peuvent être utilisés " -"dans le remplacement: $0 à $99, $+ pour le dernier groupe et $.cN pour " -"remplacer tous les caractères du groupe N par c" +"remplacé par n'importe quel caractère (un ou plusieurs identiques); les " +"groupes de correspondance peuvent être utilisés dans le remplacement: $0 à " +"$99, $+ pour le dernier groupe et $.cN pour remplacer tous les caractères du " +"groupe N par c" msgid "" "command(s) to run if conditions are OK, after regex replacements (many " diff --git a/po/hu.po b/po/hu.po index 231388aca..c75a51a02 100644 --- a/po/hu.po +++ b/po/hu.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-03-02 08:13+0100\n" +"POT-Creation-Date: 2014-03-02 08:35+0100\n" "PO-Revision-Date: 2014-02-20 12:25+0100\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -9388,9 +9388,8 @@ msgid "" "var\" (var is the hashtable variable to replace, it is optional), many regex " "can be separated by a space, for example: \"/regex1/replace1/var1 /regex2/" "replace2/var2\"; the separator \"/\" can be replaced by any char (one or " -"more identical chars), except '\\' and parentheses; matching groups can be " -"used in replace: $0 to $99, $+ for last match and $.cN to replace all chars " -"of group N by char c" +"more identical chars); matching groups can be used in replace: $0 to $99, $+ " +"for last match and $.cN to replace all chars of group N by char c" msgstr "" msgid "" diff --git a/po/it.po b/po/it.po index a9b6b4274..ac9257b74 100644 --- a/po/it.po +++ b/po/it.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-03-02 08:13+0100\n" +"POT-Creation-Date: 2014-03-02 08:35+0100\n" "PO-Revision-Date: 2014-02-20 12:25+0100\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -10417,9 +10417,8 @@ msgid "" "var\" (var is the hashtable variable to replace, it is optional), many regex " "can be separated by a space, for example: \"/regex1/replace1/var1 /regex2/" "replace2/var2\"; the separator \"/\" can be replaced by any char (one or " -"more identical chars), except '\\' and parentheses; matching groups can be " -"used in replace: $0 to $99, $+ for last match and $.cN to replace all chars " -"of group N by char c" +"more identical chars); matching groups can be used in replace: $0 to $99, $+ " +"for last match and $.cN to replace all chars of group N by char c" msgstr "" msgid "" diff --git a/po/ja.po b/po/ja.po index acdbe356e..afd2c6c67 100644 --- a/po/ja.po +++ b/po/ja.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-03-02 08:13+0100\n" +"POT-Creation-Date: 2014-03-02 08:35+0100\n" "PO-Revision-Date: 2014-02-20 12:25+0100\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese \n" @@ -10489,9 +10489,8 @@ msgid "" "var\" (var is the hashtable variable to replace, it is optional), many regex " "can be separated by a space, for example: \"/regex1/replace1/var1 /regex2/" "replace2/var2\"; the separator \"/\" can be replaced by any char (one or " -"more identical chars), except '\\' and parentheses; matching groups can be " -"used in replace: $0 to $99, $+ for last match and $.cN to replace all chars " -"of group N by char c" +"more identical chars); matching groups can be used in replace: $0 to $99, $+ " +"for last match and $.cN to replace all chars of group N by char c" msgstr "" msgid "" diff --git a/po/pl.po b/po/pl.po index 37fe90f51..7ef081fa4 100644 --- a/po/pl.po +++ b/po/pl.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-03-02 08:13+0100\n" +"POT-Creation-Date: 2014-03-02 08:35+0100\n" "PO-Revision-Date: 2014-02-20 12:25+0100\n" "Last-Translator: Krzysztof Korościk \n" "Language-Team: weechat-dev \n" @@ -10674,9 +10674,8 @@ msgid "" "var\" (var is the hashtable variable to replace, it is optional), many regex " "can be separated by a space, for example: \"/regex1/replace1/var1 /regex2/" "replace2/var2\"; the separator \"/\" can be replaced by any char (one or " -"more identical chars), except '\\' and parentheses; matching groups can be " -"used in replace: $0 to $99, $+ for last match and $.cN to replace all chars " -"of group N by char c" +"more identical chars); matching groups can be used in replace: $0 to $99, $+ " +"for last match and $.cN to replace all chars of group N by char c" msgstr "" msgid "" diff --git a/po/pt_BR.po b/po/pt_BR.po index 7653c522a..4cb62bec4 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-03-02 08:13+0100\n" +"POT-Creation-Date: 2014-03-02 08:35+0100\n" "PO-Revision-Date: 2014-02-20 12:25+0100\n" "Last-Translator: Sergio Durigan Junior \n" "Language-Team: weechat-dev \n" @@ -9620,9 +9620,8 @@ msgid "" "var\" (var is the hashtable variable to replace, it is optional), many regex " "can be separated by a space, for example: \"/regex1/replace1/var1 /regex2/" "replace2/var2\"; the separator \"/\" can be replaced by any char (one or " -"more identical chars), except '\\' and parentheses; matching groups can be " -"used in replace: $0 to $99, $+ for last match and $.cN to replace all chars " -"of group N by char c" +"more identical chars); matching groups can be used in replace: $0 to $99, $+ " +"for last match and $.cN to replace all chars of group N by char c" msgstr "" msgid "" diff --git a/po/ru.po b/po/ru.po index 8d9da4568..2af3f722b 100644 --- a/po/ru.po +++ b/po/ru.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-03-02 08:13+0100\n" +"POT-Creation-Date: 2014-03-02 08:35+0100\n" "PO-Revision-Date: 2014-02-20 12:25+0100\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -9412,9 +9412,8 @@ msgid "" "var\" (var is the hashtable variable to replace, it is optional), many regex " "can be separated by a space, for example: \"/regex1/replace1/var1 /regex2/" "replace2/var2\"; the separator \"/\" can be replaced by any char (one or " -"more identical chars), except '\\' and parentheses; matching groups can be " -"used in replace: $0 to $99, $+ for last match and $.cN to replace all chars " -"of group N by char c" +"more identical chars); matching groups can be used in replace: $0 to $99, $+ " +"for last match and $.cN to replace all chars of group N by char c" msgstr "" msgid "" diff --git a/po/tr.po b/po/tr.po index fd270a0c7..73382a75d 100644 --- a/po/tr.po +++ b/po/tr.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-03-02 08:13+0100\n" +"POT-Creation-Date: 2014-03-02 08:35+0100\n" "PO-Revision-Date: 2014-02-16 11:21+0100\n" "Last-Translator: Hasan Kiran \n" "Language-Team: weechat-dev \n" @@ -8458,9 +8458,8 @@ msgid "" "var\" (var is the hashtable variable to replace, it is optional), many regex " "can be separated by a space, for example: \"/regex1/replace1/var1 /regex2/" "replace2/var2\"; the separator \"/\" can be replaced by any char (one or " -"more identical chars), except '\\' and parentheses; matching groups can be " -"used in replace: $0 to $99, $+ for last match and $.cN to replace all chars " -"of group N by char c" +"more identical chars); matching groups can be used in replace: $0 to $99, $+ " +"for last match and $.cN to replace all chars of group N by char c" msgstr "" msgid "" diff --git a/po/weechat.pot b/po/weechat.pot index fef2e6fc4..1fa35baeb 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.4.1-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-03-02 08:13+0100\n" +"POT-Creation-Date: 2014-03-02 08:35+0100\n" "PO-Revision-Date: 2013-02-14 18:20+0100\n" "Last-Translator: FULL NAME \n" "Language-Team: weechat-dev \n" @@ -8403,9 +8403,8 @@ msgid "" "var\" (var is the hashtable variable to replace, it is optional), many regex " "can be separated by a space, for example: \"/regex1/replace1/var1 /regex2/" "replace2/var2\"; the separator \"/\" can be replaced by any char (one or " -"more identical chars), except '\\' and parentheses; matching groups can be " -"used in replace: $0 to $99, $+ for last match and $.cN to replace all chars " -"of group N by char c" +"more identical chars); matching groups can be used in replace: $0 to $99, $+ " +"for last match and $.cN to replace all chars of group N by char c" msgstr "" msgid "" diff --git a/src/plugins/trigger/trigger-config.c b/src/plugins/trigger/trigger-config.c index ff158a440..970929d77 100644 --- a/src/plugins/trigger/trigger-config.c +++ b/src/plugins/trigger/trigger-config.c @@ -310,9 +310,9 @@ trigger_config_create_trigger_option (const char *trigger_name, int index_option "many regex can be separated by a space, for example: " "\"/regex1/replace1/var1 /regex2/replace2/var2\"; the " "separator \"/\" can be replaced by any char (one or more " - "identical chars), except '\\' and parentheses; matching " - "groups can be used in replace: $0 to $99, $+ for last " - "match and $.cN to replace all chars of group N by char c"), + "identical chars); matching groups can be used in replace: " + "$0 to $99, $+ for last match and $.cN to replace all chars " + "of group N by char c"), NULL, 0, 0, value, NULL, 0, NULL, NULL, &trigger_config_change_trigger_regex, NULL, NULL, NULL); break; diff --git a/src/plugins/trigger/trigger.c b/src/plugins/trigger/trigger.c index 45953dcb1..acb5bb4e1 100644 --- a/src/plugins/trigger/trigger.c +++ b/src/plugins/trigger/trigger.c @@ -534,8 +534,6 @@ trigger_regex_split (const char *str_regex, delimiter = weechat_strndup (ptr_regex, pos - ptr_regex); if (!delimiter) goto memory_error; - if ((strcmp (delimiter, "\\") == 0) || (strcmp (delimiter, "(") == 0)) - goto format_error; length_delimiter = strlen (delimiter);