+%option nounput never-interactive
+
%{
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (c) 2001-2002 by Hiroyuki Yamamoto & The Sylpheed Claws Team.
+ * Copyright (c) 2001-2007 by Hiroyuki Yamamoto & The Claws Mail Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
*/
#include <string.h>
#include "codeconv.h"
#include "matcher.h"
#include "matcher_parser_lex.h"
+
#ifndef YYSTYPE
#include "matcher_parser_parse.h"
#endif
-#define MAX_STR_CONST 512
-#define YY_NO_UNPUT 1
+
+#define MAX_STR_CONST 8192
static char string_buf[MAX_STR_CONST];
static char *string_buf_ptr;
%%
+"in" return MATCHER_IN;
+
/*
* a keyword consists of alpha and underscore
* characters, possibly preceded by a tilde (~)
if (!g_utf8_validate(string_buf, -1, NULL)) {
gchar *tmp = conv_codeset_strdup(string_buf, conv_get_locale_charset_str(), CS_INTERNAL);
if (tmp) {
- strcpy(string_buf, tmp);
+ g_strlcpy(string_buf, tmp, sizeof(string_buf));
g_free(tmp);
}
}
<string>. {
add_char(yytext[0]);
}
-\[[^\[\]]*\] {
+^\[.*\]$ {
/* for section name in configuration file */
BEGIN(0);
yylval.str = yytext + 1;
rulename {
return MATCHER_RULENAME;
}
+disabled {
+ return MATCHER_DISABLED;
+ }
+account {
+ return MATCHER_ACCOUNT;
+ }
+enabled {
+ return MATCHER_ENABLED;
+ }
%%