[#9642] Re: host.conf は参照しないの? — akira yamada / やまだあきら <akira@...>

15 messages 2000/05/09

[#9672] IO.popen — Koji Arai <JCA02266@...>

新井です。

22 messages 2000/05/13
[#9673] Re: IO.popen — Koji Arai <JCA02266@...> 2000/05/13

新井です。

[#9682] Re: IO.popen — matz@... (Yukihiro Matsumoto) 2000/05/14

まつもと ゆきひろです

[#9676] support mingw32 — WATANABE Hirofumi <eban@...>

わたなべです.

32 messages 2000/05/13
[#9678] Re: support mingw32 — Masaki Suketa <CQN02273@...> 2000/05/14

助田です.

[#9680] Re: support mingw32 — WATANABE Hirofumi <eban@...> 2000/05/14

わたなべです.

[#9686] Re: support mingw32 — Katsuyuki Komatsu <komatsu@...> 2000/05/15

小松です。

[#9687] Re: support mingw32 — WATANABE Hirofumi <Hirofumi.Watanabe@...> 2000/05/15

わたなべです.

[#9806] rescue variable syntax — matz@... (Yukihiro Matsumoto)

まつもと ゆきひろです

40 messages 2000/05/24
[#9811] Re: rescue variable syntax — ARIMA Yasuhiro <fit0298@...> 2000/05/24

有馬です。

[#9814] Re: rescue variable syntax — matz@... (Yukihiro Matsumoto) 2000/05/24

まつもと ゆきひろです

[#9821] Re: rescue variable syntax — nobu.nakada@... 2000/05/25

なかだです。

[#9823] Re: rescue variable syntax — ARIMA Yasuhiro <fit0298@...> 2000/05/25

有馬です。

[#9833] Re: rescue variable syntax — matz@... (Yukihiro Matsumoto) 2000/05/25

まつもと ゆきひろです

[#9861] Re: rescue variable syntax — gotoken@... (GOTO Kentaro) 2000/05/25

ごとけんです

[#9866] Re: rescue variable syntax — matz@... (Yukihiro Matsumoto) 2000/05/25

まつもと ゆきひろです

[#9870] Re: rescue variable syntax — nagai@... 2000/05/26

永井@知能.九工大です.

[#9873] Re: rescue variable syntax — matz@... (Yukihiro Matsumoto) 2000/05/27

まつもと ゆきひろです

[#9812] Forward: Error in NT makefile (PR#7) — matz@... (Yukihiro Matsumoto)

まつもと ゆきひろです

21 messages 2000/05/24
[#9820] Re: Forward: Error in NT makefile (PR#7) — Katsuyuki Komatsu <komatsu@...> 2000/05/25

小松です。

[#9842] Re: Forward: Error in NT makefile (PR#7) — WATANABE Hirofumi <Hirofumi.Watanabe@...> 2000/05/25

わたなべです.

[#9855] Re: Forward: Error in NT makefile (PR#7) — Katsuyuki Komatsu <komatsu@...> 2000/05/25

小松です。

[#9879] Re: Forward: Error in NT makefile (PR#7) — WATANABE Hirofumi <eban@...> 2000/05/28

わたなべです.

[#9857] $0 handling on NT — Katsuyuki Komatsu <komatsu@...>

小松です。

18 messages 2000/05/25
[#9869] Re: $0 handling on NT — nobu.nakada@... 2000/05/26

なかだです。

[ruby-dev:9672] IO.popen

From: Koji Arai <JCA02266@...>
Date: 2000-05-13 14:29:23 UTC
List: ruby-dev #9672
新井です。

1.5のpopen()で、

p IO.popen("-", "w")

#<IO:0x4011a6ac>
-:1:in `popen': yield called out of iterator (LocalJumpError)
	from -:1

となってしまいます。1.4互換なら以下の修正でどうでしょ?
# 紛らわしい気がしたので、変数の使い回しも止めました。

Sat May 13 14:21:15 2000  Koji Arai  <JCA02266@nifty.ne.jp>

	* io.c (rb_io_s_popen): should check whether has a block.

Index: io.c
===================================================================
RCS file: /home/cvs/ruby/io.c,v
retrieving revision 1.28
diff -u -p -u -r1.28 io.c
--- io.c	2000/05/12 09:07:41	1.28
+++ io.c	2000/05/13 14:21:15
@@ -1592,12 +1592,14 @@ rb_io_s_popen(argc, argv, self)
     Check_SafeStr(pname);
     port = pipe_open(RSTRING(pname)->ptr, mode);
     if (NIL_P(port)) {
+	/* child */
 	if (!NIL_P(proc)) {
 	    rb_eval_cmd(proc, rb_ary_new2(0));
 	}
-	else {
-	    rb_yield(port);
+	else if (rb_iterator_p()) {
+	    rb_yield(Qnil);
 	}
+	return Qnil;
     }
     else if (rb_iterator_p()) {
 	return rb_ensure(rb_yield, port, rb_io_close, port);

--
新井康司 (Koji Arai)

In This Thread

Prev Next