[#615] [MethodIndex] <!-- hhmts ... — keiju@... (Keiju ISHITSUKA)
けいじゅ@日本ラショナルソフトウェアです.
13 messages
1997/10/01
[#616] Re: [MethodIndex] <!-- hhmts ...
— matz@... (Yukihiro Matsumoto)
1997/10/01
まつもと ゆきひろです
[#617] Re: [MethodIndex] <!-- hhmts ...
— keiju@... (石塚圭樹 )
1997/10/01
けいじゅ@日本ラショナルソフトウェアです.
[#618] Re: [MethodIndex] <!-- hhmts ...
— matz@... (Yukihiro Matsumoto)
1997/10/01
まつもと ゆきひろです
[#619] Re: [MethodIndex] <!-- hhmts ...
— keiju@... (石塚圭樹 )
1997/10/01
けいじゅ@日本ラショナルソフトウェアです.
[#620] Re: [MethodIndex] <!-- hhmts ...
— matz@... (Yukihiro Matsumoto)
1997/10/01
まつもと ゆきひろです
[#626] [MethodIndex] *.html 修正要求 — keiju@... (Keiju ISHITSUKA)
--------
5 messages
1997/10/02
[#645] pack/unpack base64 — WATANABE Hirofumi <watanabe@...>
わたなべです.
18 messages
1997/10/06
[#646] Re: pack/unpack base64
— matz@... (Yukihiro Matsumoto)
1997/10/06
まつもと ゆきひろです
[#650] Re: pack/unpack base64
— WATANABE Hirofumi <watanabe@...>
1997/10/06
わたなべです.
[#651] Re: pack/unpack base64
— matz@... (Yukihiro Matsumoto)
1997/10/06
まつもと ゆきひろです
[#655] Re: pack/unpack base64
— WATANABE Hirofumi <watanabe@...>
1997/10/07
わたなべです.
[#657] Re: pack/unpack base64
— Eiji-usagi-MATSUmoto <ematsu@...>
1997/10/07
うさぎです
[#660] Re: pack/unpack base64
— WATANABE Hirofumi <watanabe@...>
1997/10/07
わたなべです.
[#684] Re: pack/unpack base64
— Eiji-usagi-MATSUmoto <ematsu@...>
1997/10/07
うさぎです。
[#652] ruby-1.0-971003 — HYOUDOU Kouichi /note <hyoudo@...>
兵藤です
10 messages
1997/10/06
[#654] [BUG?] ruby -r nothing-file — keiju@... (Keiju ISHITSUKA)
けいじゅ@日本ラショナルソフトウェアです.
29 messages
1997/10/06
[#661] Re: [BUG?] ruby -r nothing-file
— matz@... (Yukihiro Matsumoto)
1997/10/07
まつもと ゆきひろです
[#662] Re: [BUG?] ruby -r nothing-file
— WATANABE Hirofumi <watanabe@...>
1997/10/07
わたなべです.
[#663] Re: [BUG?] ruby -r nothing-file
— matz@... (Yukihiro Matsumoto)
1997/10/07
まつもと ゆきひろです
[#666] Re: [BUG?] ruby -r nothing-file
— keiju@... (石塚圭樹 )
1997/10/07
けいじゅ@日本ラショナルソフトウェアです.
[#667] Re: [BUG?] ruby -r nothing-file
— matz@... (Yukihiro Matsumoto)
1997/10/07
まつもと ゆきひろです
[#669] Re: [BUG?] ruby -r nothing-file
— keiju@... (石塚圭樹 )
1997/10/07
けいじゅ@日本ラショナルソフトウェアです.
[#670] Re: [BUG?] ruby -r nothing-file
— matz@... (Yukihiro Matsumoto)
1997/10/07
まつもと ゆきひろです
[#671] Re: [BUG?] ruby -r nothing-file
— keiju@... (石塚圭樹 )
1997/10/07
けいじゅ@日本ラショナルソフトウェアです.
[#672] Re: [BUG?] ruby -r nothing-file
— matz@... (Yukihiro Matsumoto)
1997/10/07
まつもと ゆきひろです
[#673] Re: [BUG?] ruby -r nothing-file
— WATANABE Hirofumi <watanabe@...>
1997/10/07
わたなべです.
[#674] Re: [BUG?] ruby -r nothing-file
— matz@... (Yukihiro Matsumoto)
1997/10/07
まつもと ゆきひろです
[#675] Re: [BUG?] ruby -r nothing-file
— WATANABE Hirofumi <watanabe@...>
1997/10/07
わたなべです.
[#676] Re: [BUG?] ruby -r nothing-file
— keiju@... (石塚圭樹 )
1997/10/07
けいじゅ@日本ラショナルソフトウェアです.
[#677] Re: [BUG?] ruby -r nothing-file
— matz@... (Yukihiro Matsumoto)
1997/10/07
まつもと ゆきひろです
[#678] Re: [BUG?] ruby -r nothing-file
— keiju@... (石塚圭樹 )
1997/10/07
けいじゅ@日本ラショナルソフトウェアです.
[#679] Re: [BUG?] ruby -r nothing-file
— matz@... (Yukihiro Matsumoto)
1997/10/07
まつもと ゆきひろです
[#680] Re: [BUG?] ruby -r nothing-file
— WATANABE Hirofumi <watanabe@...>
1997/10/07
わたなべです.
[#682] Re: [BUG?] ruby -r nothing-file
— keiju@... (石塚圭樹 )
1997/10/07
けいじゅ@日本ラショナルソフトウェアです.
[#665] [BUG] Exception.new — keiju@... (Keiju ISHITSUKA)
けいじゅ@日本ラショナルソフトウェアです.
2 messages
1997/10/07
[#713] [REQ] require/load — keiju@... (Keiju ISHITSUKA)
けいじゅ@日本ラショナルソフトウェアです.
9 messages
1997/10/09
[#714] Re: [REQ] require/load
— matz@... (Yukihiro Matsumoto)
1997/10/09
まつもと ゆきひろです
[#715] Re: [REQ] require/load
— keiju@... (石塚圭樹 )
1997/10/09
けいじゅ@日本ラショナルソフトウェアです.
[#721] ruby on sparc-openbsd — "EGUCHI Osamu" <eguchi@...>
えぐち です。
7 messages
1997/10/10
[#738] cbreak.rb — WATANABE Hirofumi <watanabe@...>
わたなべです.
5 messages
1997/10/15
[#755] The default def. of "hash" — Shin-ichiro HARA <sinara@...>
原です。
6 messages
1997/10/20
[#770] printn means print and newline — HYOUDOU Kouichi /note <hyoudo@...>
兵藤です%思い付きなのですが
19 messages
1997/10/28
[#771] Re: printn means print and newline
— shugo@... (Shugo Maeda)
1997/10/28
前田です。
[#772] Re: printn means print and newline
— tateishi@... (Tateishi Takaaki)
1997/10/28
●以下「shugo@po.aianet.ne.jp」さんより
[#779] Re: printn means print and newline
— HYOUDOU Kouichi /note <hyoudo@...>
1997/10/30
兵藤です%もうすこしだけアプローチ..
[#780] Re: printn means print and newline
— matz@... (Yukihiro Matsumoto)
1997/10/31
まつもと ゆきひろです
[ruby-dev:777] [BUG] p "".chop
From:
WATANABE Hirofumi <watanabe@...>
Date:
1997-10-30 07:06:52 UTC
List:
ruby-dev #777
わたなべです.
p "".chop が SEGV です.
で, ついでにそういう println がありなら chomp もあってもいい
かなと思うんだけど, だめなら @@ -1948,2 +1950,39 @@ 以降を削
除してください.
Kconv#nkf もそのうち作ります. ;-)
--
わたなべひろふみ
--- string.c.orig Wed Sep 24 18:16:08 1997
+++ string.c Thu Oct 30 16:03:14 1997
@@ -1916,9 +1916,11 @@
- str->len--;
- if (str->ptr[str->len] == '\n') {
- if (str->len > 0 && str->ptr[str->len-1] == '\r') {
- str->len--;
+ if (str->len > 0) {
+ str->len--;
+ if (str->ptr[str->len] == '\n') {
+ if (str->len > 0 && str->ptr[str->len-1] == '\r') {
+ str->len--;
+ }
}
+ str->ptr[str->len] = '\0';
}
- str->ptr[str->len] = '\0';
@@ -1948,2 +1950,39 @@
static VALUE
+str_chomp_bang(str)
+ struct RString *str;
+{
+ str_modify(str);
+
+ if (str->len > 0 && str->ptr[str->len-1] == '\n') {
+ str->len--;
+ if (str->len > 0 && str->ptr[str->len-1] == '\r') {
+ str->len--;
+ }
+ str->ptr[str->len] = '\0';
+ }
+
+ return (VALUE)str;
+}
+
+static VALUE
+str_chomp(str)
+ struct RString *str;
+{
+ return str_chomp_bang(str_dup(str));
+}
+
+static VALUE
+f_chomp_bang(str)
+ struct RString *str;
+{
+ return str_chomp_bang(uscore_get());
+}
+
+static VALUE
+f_chomp()
+{
+ return str_chomp_bang(str_dup(uscore_get()));
+}
+
+static VALUE
str_strip_bang(str)
@@ -2264,2 +2303,3 @@
rb_define_method(cString, "chop", str_chop, 0);
+ rb_define_method(cString, "chomp", str_chomp, 0);
rb_define_method(cString, "strip", str_strip, 0);
@@ -2270,2 +2310,3 @@
rb_define_method(cString, "chop!", str_chop_bang, 0);
+ rb_define_method(cString, "chomp!", str_chomp_bang, 0);
@@ -2295,2 +2336,5 @@
rb_define_global_function("chop!", f_chop_bang, 0);
+
+ rb_define_global_function("chomp", f_chomp, 0);
+ rb_define_global_function("chomp!", f_chomp_bang, 0);