summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-03-27 23:40:32 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-03-27 23:40:32 +0000
commita1b5313e4e8dc58a6d5081f34c542f5f3ade34e0 (patch)
tree41f636b244a7d17014aaef99bfa9e3f2a6d90058
parente5867c4b29edf6e4f95e04477d97223fe64742dd (diff)
* ext/iconv/iconv.c (iconv_create): Iconv::Failure requires 3
arguments. (pointed out by NaHi) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog15
-rw-r--r--ext/iconv/iconv.c17
2 files changed, 20 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index d1ca5fb780..d937631af4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,12 @@
+Mon Mar 28 08:39:49 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/iconv/iconv.c (iconv_create): Iconv::Failure requires 3
+ arguments. (pointed out by NaHi)
+
Sat Mar 26 22:51:33 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk.rb (_callback_entry_class?): add for checking whether
- a class is available for a callback entry.
+ a class is available for a callback entry.
* ext/tk/lib/tk.rb (after_cancel): add Tk.after_cancel(afterID) method.
@@ -9,7 +14,7 @@ Sat Mar 26 22:51:33 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
of TkComm to public module method.
* ext/tk/lib/tk.rb (cget): add check that slot argument is not
- empty string.
+ empty string.
* ext/tk/lib/tk.rb (configinfo): ditto.
@@ -19,16 +24,16 @@ Sat Mar 26 22:51:33 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tk/itemconfig.rb (itemconfiginfo): ditto.
* ext/tk/lib/tk/entry.rb: add TkEntry#icursor and icursor= (alias of
- cursor and cursor= method).
+ cursor and cursor= method).
* ext/tk/lib/tk/font.rb: improve font treatment when the font name is
empty string.
* ext/tk/lib/tk/variable.rb: add :variable, :window and :procedure
- type.
+ type.
* ext/tk/lib/tk/variable.rb: improve treatment of array-type
- tkvariable.
+ tkvariable.
* ext/tk/lib/tkextlib/blt.rb: add commands for zooming.
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
index d8958c0e3f..65dd07f7de 100644
--- a/ext/iconv/iconv.c
+++ b/ext/iconv/iconv.c
@@ -169,14 +169,17 @@ iconv_create
}
if (cd == (iconv_t)-1) {
int inval = errno == EINVAL;
- volatile VALUE msg = rb_str_new2("iconv(\"" + (inval ? 5 : 0));
- char *s;
-
- rb_str_buf_cat2(rb_str_buf_append(msg, to), "\", \"");
- rb_str_buf_cat2(rb_str_buf_append(msg, from), "\")");
- s = StringValuePtr(msg);
+ char *s = inval ? "invalid encoding " : "iconv";
+ volatile VALUE msg = rb_str_new(0, strlen(s) + RSTRING(to)->len +
+ RSTRING(from)->len + 8);
+
+ sprintf(RSTRING(msg)->ptr, "%s(\"%s\", \"%s\")",
+ s, RSTRING(to)->ptr, RSTRING(from)->ptr);
+ s = RSTRING(msg)->ptr;
+ RSTRING(msg)->len = strlen(s);
if (!inval) rb_sys_fail(s);
- rb_raise(rb_eIconvInvalidEncoding, "invalid encoding %s", s);
+ iconv_fail(rb_eIconvInvalidEncoding,
+ Qnil, rb_ary_new3(2, to, from), NULL, s);
}
}