From 9fc7ba486d0a17cb4503319f0bb2c675f96ea0c1 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 26 Jan 2012 15:39:12 -0800 Subject: * lib.c (cat_str): Throw error if one of the list elements is not a character or string instead of silently returning nil. --- ChangeLog | 5 +++++ lib.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 783aa5a2..acef717f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-01-26 Kaz Kylheku + + * lib.c (cat_str): Throw error if one of the list elements + is not a character or string instead of silently returning nil. + 2012-01-26 Kaz Kylheku * txr.1: More discussion of ranges. diff --git a/lib.c b/lib.c index e71b87cd..29049969 100644 --- a/lib.c +++ b/lib.c @@ -1502,7 +1502,8 @@ val cat_str(val list, val sep) total += len_sep; continue; } - return nil; + uw_throwf(error_s, lit("cat_str: ~s is not a character or string"), + item, nao); } str = (wchar_t *) chk_malloc((total + 1) * sizeof *str); -- cgit v1.2.3