From 3e2cb3dda617f6d2a97e5df635d592a691d3c9b0 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 16 Apr 2007 14:52:56 +0000 Subject: [PATCH] (parse_map_in): Improve error message when user attempts to use THRU with string variables. Suggested by seth@swoolley.homeip.net. --- src/language/xforms/ChangeLog | 6 ++++++ src/language/xforms/recode.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/language/xforms/ChangeLog b/src/language/xforms/ChangeLog index 84afa3e0..4e15b1ed 100644 --- a/src/language/xforms/ChangeLog +++ b/src/language/xforms/ChangeLog @@ -1,3 +1,9 @@ +2007-04-16 Ben Pfaff + + * recode.c (parse_map_in): Improve error message when user + attempts to use THRU with string variables. + Suggested by seth@swoolley.homeip.net. + 2007-04-15 Ben Pfaff * recode.c (parse_mappings): Initialize "out" member of mapping diff --git a/src/language/xforms/recode.c b/src/language/xforms/recode.c index b0a6b732..83d48553 100644 --- a/src/language/xforms/recode.c +++ b/src/language/xforms/recode.c @@ -313,6 +313,12 @@ parse_map_in (struct lexer *lexer, struct map_in *in, struct pool *pool, return false; set_map_in_str (in, pool, lex_tokstr (lexer), max_src_width); lex_get (lexer); + if (lex_token (lexer) == T_ID + && lex_id_match (ss_cstr ("THRU"), ss_cstr (lex_tokid (lexer)))) + { + msg (SE, _("THRU is not allowed with string variables.")); + return false; + } } return true; -- 2.30.2