Permalink
Browse files

* io.c (rb_io_ctl): do not call ioctl/fcntl for f2, if f and f2

  have same fileno.

* eval.c (rb_load): raise LocaJumpError if unexpected local jumps
  appear during load.

* ext/socket/socket.c (bsock_close_read): don't call rb_thread_fd_close();
  it's supposed to be called by io_io_close().

* ext/socket/socket.c (bsock_close_read): do not modify f and f2.

* ext/socket/socket.c (bsock_close_write): ditto.

* ext/socket/socket.c (sock_new): avoid dup(2) on sockets.

* parse.y (primary): preserve and clear in_single and in_def using
  stack to prevent nested method errors in singleton class bodies.


git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@1177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
1 parent 0b32035 commit 73e5f4bc9c528f24bd1230f82a7d12b8e2f8a11d @matz matz committed Feb 13, 2001
Showing with 429 additions and 147 deletions.
  1. +38 −1 ChangeLog
  2. +1 −3 ToDo
  3. +16 −5 dir.c
  4. +36 −38 eval.c
  5. +57 −14 ext/dbm/dbm.c
  6. +208 −35 ext/gdbm/gdbm.c
  7. +2 −2 ext/socket/extconf.rb
  8. +2 −18 ext/socket/socket.c
  9. +4 −5 hash.c
  10. +30 −2 io.c
  11. +0 −1 lib/cgi/session.rb
  12. +1 −2 lib/importenv.rb
  13. +32 −20 parse.y
  14. +2 −1 regex.c
View
@@ -7,7 +7,40 @@ Sun Feb 11 16:00:30 2001 WATANABE Hirofumi <eban@ruby-lang.org>
* configure.in: add ac_cv_func_getpgrp_void=yes on DJGPP.
-Fri Feb 10 00:00:30 2001 Nobuyoshi Nakada <nobu.nakada@nifty.ne.jp>
+Tue Feb 13 08:43:10 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * io.c (rb_io_ctl): do not call ioctl/fcntl for f2, if f and f2
+ have same fileno.
+
+Tue Feb 13 01:13:43 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * eval.c (rb_load): raise LocaJumpError if unexpected local jumps
+ appear during load.
+
+ * ext/socket/socket.c (bsock_close_read): don't call rb_thread_fd_close();
+ it's supposed to be called by io_io_close().
+
+ * ext/socket/socket.c (bsock_close_read): do not modify f and f2.
+
+ * ext/socket/socket.c (bsock_close_write): ditto.
+
+ * ext/socket/socket.c (sock_new): avoid dup(2) on sockets.
+
+ * parse.y (primary): preserve and clear in_single and in_def using
+ stack to prevent nested method errors in singleton class bodies.
+
+Sat Feb 10 23:43:49 2001 Nobuyoshi Nakada <nobu.nakada@nifty.ne.jp>
+
+ * hash.c (rb_any_hash): dumped core on machines sizeof(int) != sizeof(long).
+
+Sat Feb 10 23:07:15 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * io.c (rb_io_s_for_fd): IO::for_fd(fd) - new method.
+
+ * regex.c (PREV_IS_A_LETTER): should not treat c>0x7f as a word
+ character if -Kn.
+
+Sat Feb 10 00:00:30 2001 Nobuyoshi Nakada <nobu.nakada@nifty.ne.jp>
* win32/win32.c (win32_stat): replace stat for enable when pathname
ends with '/' or '\' for mswin32 on Win9X / Win2k.
@@ -25,6 +58,10 @@ Fri Feb 9 22:54:57 2001 WATANABE Hirofumi <eban@ruby-lang.org>
* ruby.c (ruby_init_loadpath): convert '\\' to '/'
before finding executable file path.
+Fri Feb 9 17:41:53 2001 Triet H. Lai <thlai@mail.usyd.edu.au>
+
+ * dir.c (rb_glob_helper): do not follow symbolic links.
+
Thu Feb 8 21:27:24 2001 WATANABE Hirofumi <eban@ruby-lang.org>
* lib/mkmf.rb (install_rb): fix handling of relative path.
View
4 ToDo
@@ -1,6 +1,5 @@
Language Spec.
-- %q!\!! => "!" (not "\\!")
* operator !! for rescue. ???
* objectify characters
* ../... outside condition invokes operator method too.
@@ -45,13 +44,13 @@ Hacking Interpreter
* warn for inconsistent local variable usage (lv m and method m at the same time).
* MicroRuby
* Built-in Interactive Ruby.
-* regex /\ba/ on "[a in HIRAGANA]a[a in HIRAGANA]"
Standard Libraries
- Module#define_method which takes a name and a body (block, proc or method).
- Enume#inject
- Array#fetch
+- IO::for_fd
* Enumerable#sort_by for Schwartzian transformation
* String#scanf(?)
* Object#fmt(?)
@@ -67,7 +66,6 @@ Standard Libraries
* Process::waitall [ruby-talk:4557]
* synchronized method - synchronized{...}, synchronized :foo, :bar
* move Time::times to Process.
-* IO#for_fd in general
* Array#&, Array#| to allow duplication. ???
* fork_and_kill_other_threads.
* way to specify immortal (fork endurance) thread;
View
21 dir.c
@@ -601,11 +601,22 @@ rb_glob_helper(path, flag, func, arg)
rb_glob_helper(buf, flag, func, arg);
free(buf);
}
- dirp = opendir(dir);
- if (dirp == NULL) {
- free(base);
- break;
+ if (lstat(dir, &st) < 0) {
+ free(base);
+ break;
}
+ if (S_ISDIR(st.st_mode)) {
+ dirp = opendir(dir);
+ if (dirp == NULL) {
+ free(base);
+ break;
+ }
+ }
+ else {
+ free(base);
+ break;
+ }
+
#define BASE (*base && !(*base == '/' && !base[1]))
for (dp = readdir(dirp); dp != NULL; dp = readdir(dirp)) {
@@ -636,7 +647,7 @@ rb_glob_helper(path, flag, func, arg)
free(base);
free(magic);
while (link) {
- stat(link->path, &st); /* should success */
+ lstat(link->path, &st); /* should success */
if (S_ISDIR(st.st_mode)) {
int len = strlen(link->path);
int mlen = strlen(m);
View
74 eval.c
@@ -1298,6 +1298,34 @@ rb_eval_string_wrap(str, state)
return val;
}
+static void
+jump_tag_but_local_jump(state)
+ int state;
+{
+ switch (state) {
+ case 0:
+ break;
+ case TAG_RETURN:
+ rb_raise(rb_eLocalJumpError, "unexpected return");
+ break;
+ case TAG_NEXT:
+ rb_raise(rb_eLocalJumpError, "unexpected next");
+ break;
+ case TAG_BREAK:
+ rb_raise(rb_eLocalJumpError, "unexpected break");
+ break;
+ case TAG_REDO:
+ rb_raise(rb_eLocalJumpError, "unexpected redo");
+ break;
+ case TAG_RETRY:
+ rb_raise(rb_eLocalJumpError, "retry outside of rescue clause");
+ break;
+ default:
+ JUMP_TAG(state);
+ break;
+ }
+}
+
VALUE
rb_eval_cmd(cmd, arg)
VALUE cmd, arg;
@@ -1333,28 +1361,7 @@ rb_eval_cmd(cmd, arg)
POP_TAG();
POP_CLASS();
- switch (state) {
- case 0:
- break;
- case TAG_RETURN:
- rb_raise(rb_eLocalJumpError, "unexpected return");
- break;
- case TAG_NEXT:
- rb_raise(rb_eLocalJumpError, "unexpected next");
- break;
- case TAG_BREAK:
- rb_raise(rb_eLocalJumpError, "unexpected break");
- break;
- case TAG_REDO:
- rb_raise(rb_eLocalJumpError, "unexpected redo");
- break;
- case TAG_RETRY:
- rb_raise(rb_eLocalJumpError, "retry outside of rescue clause");
- break;
- default:
- JUMP_TAG(state);
- break;
- }
+ jump_tag_but_local_jump(state);
return val;
}
@@ -3644,10 +3651,8 @@ rb_yield_0(val, self, klass, acheck)
if (!block->tag) {
switch (state & TAG_MASK) {
case TAG_BREAK:
- rb_raise(rb_eLocalJumpError, "unexpected break");
- break;
case TAG_RETURN:
- rb_raise(rb_eLocalJumpError, "unexpected return");
+ jump_tag_but_local_jump(state & TAG_MASK);
break;
}
}
@@ -4454,21 +4459,14 @@ rb_call0(klass, recv, id, argc, argv, body, nosuper)
case 0:
break;
- case TAG_NEXT:
- rb_raise(rb_eLocalJumpError, "unexpected next");
- break;
- case TAG_BREAK:
- rb_raise(rb_eLocalJumpError, "unexpected break");
- break;
- case TAG_REDO:
- rb_raise(rb_eLocalJumpError, "unexpected redo");
- break;
case TAG_RETRY:
- if (!rb_block_given_p()) {
- rb_raise(rb_eLocalJumpError, "retry outside of rescue clause");
+ if (rb_block_given_p()) {
+ break;
}
+ /* fall through */
default:
- JUMP_TAG(state);
+ jump_tag_but_local_jump(state);
+ break;
}
}
}
@@ -5189,7 +5187,7 @@ rb_load(fname, wrap)
rb_exc_raise(ruby_errinfo);
}
TMP_PROTECT_END;
- if (state) JUMP_TAG(state);
+ if (state) jump_tag_but_local_jump(state);
if (!NIL_P(ruby_errinfo)) /* exception during load */
rb_exc_raise(ruby_errinfo);
}
Oops, something went wrong.

0 comments on commit 73e5f4b

Please sign in to comment.