diff options
-rw-r--r-- | ChangeLog | 26 | ||||
-rw-r--r-- | array.c | 2 | ||||
-rw-r--r-- | bignum.c | 2 | ||||
-rw-r--r-- | class.c | 2 | ||||
-rw-r--r-- | compar.c | 2 | ||||
-rw-r--r-- | dir.c | 48 | ||||
-rw-r--r-- | dln.c | 2 | ||||
-rw-r--r-- | dln.h | 2 | ||||
-rw-r--r-- | env.h | 2 | ||||
-rw-r--r-- | eval.c | 6 | ||||
-rw-r--r-- | ext/dbm/dbm.c | 2 | ||||
-rw-r--r-- | ext/fcntl/fcntl.c | 2 | ||||
-rw-r--r-- | ext/md5/md5init.c | 2 | ||||
-rw-r--r-- | ext/sdbm/init.c | 2 | ||||
-rw-r--r-- | hash.c | 2 | ||||
-rw-r--r-- | inits.c | 2 | ||||
-rw-r--r-- | intern.h | 2 | ||||
-rw-r--r-- | main.c | 2 | ||||
-rw-r--r-- | marshal.c | 2 | ||||
-rw-r--r-- | math.c | 2 | ||||
-rw-r--r-- | node.h | 2 | ||||
-rw-r--r-- | numeric.c | 2 | ||||
-rw-r--r-- | prec.c | 2 | ||||
-rw-r--r-- | random.c | 2 | ||||
-rw-r--r-- | range.c | 2 | ||||
-rw-r--r-- | re.h | 2 | ||||
-rw-r--r-- | rubyio.h | 2 | ||||
-rw-r--r-- | rubysig.h | 2 | ||||
-rw-r--r-- | signal.c | 2 | ||||
-rw-r--r-- | struct.c | 2 | ||||
-rw-r--r-- | time.c | 2 | ||||
-rw-r--r-- | util.c | 2 | ||||
-rw-r--r-- | util.h | 2 | ||||
-rw-r--r-- | variable.c | 2 | ||||
-rw-r--r-- | version.c | 4 |
35 files changed, 98 insertions, 48 deletions
@@ -1,8 +1,34 @@ +Wed Feb 14 00:44:17 2001 Yukihiro Matsumoto <matz@ruby-lang.org> + + * dir.c (dir_s_glob): supprt backslash escape of metacharacters + and delimiters. + + * dir.c (remove_backslases): remove backslashes from path before + calling stat(2). + + * dir.c (dir_s_glob): call rb_yield directly (via push_pattern) if + block is given to the method. + + * dir.c (push_pattern): do not call rb_ary_push; yield directly. + + * eval.c (blk_copy_prev): reduced ALLOC_N too much. + + * eval.c (frame_dup): ditto. + Tue Feb 13 23:05:38 2001 WATANABE Hirofumi <eban@ruby-lang.org> * dir.c (lstat): should use rb_sys_stat if lstat(2) is not available. +Sun Feb 11 16:00:30 2001 WATANABE Hirofumi <eban@ruby-lang.org> + + * eval.c (stack_length): use __builtin_frame_address() only if + GCC and i386 CPU. + + * gc.c (rb_gc, Init_stack): ditto. + + * configure.in: add ac_cv_func_getpgrp_void=yes on DJGPP. + 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 @@ -6,7 +6,7 @@ $Date$ created at: Fri Aug 6 09:46:12 JST 1993 - Copyright (C) 1993-2000 Yukihiro Matsumoto + Copyright (C) 1993-2001 Yukihiro Matsumoto Copyright (C) 2000 Network Applied Communication Laboratory, Inc. Copyright (C) 2000 Information-technology Promotion Agency, Japan @@ -6,7 +6,7 @@ $Date$ created at: Fri Jun 10 00:48:55 JST 1994 - Copyright (C) 1993-2000 Yukihiro Matsumoto + Copyright (C) 1993-2001 Yukihiro Matsumoto **********************************************************************/ @@ -6,7 +6,7 @@ $Date$ created at: Tue Aug 10 15:05:44 JST 1993 - Copyright (C) 1993-2000 Yukihiro Matsumoto + Copyright (C) 1993-2001 Yukihiro Matsumoto **********************************************************************/ @@ -6,7 +6,7 @@ $Date$ created at: Thu Aug 26 14:39:48 JST 1993 - Copyright (C) 1993-2000 Yukihiro Matsumoto + Copyright (C) 1993-2001 Yukihiro Matsumoto **********************************************************************/ @@ -6,7 +6,7 @@ $Date$ created at: Wed Jan 5 09:51:01 JST 1994 - Copyright (C) 1993-2000 Yukihiro Matsumoto + Copyright (C) 1993-2001 Yukihiro Matsumoto Copyright (C) 2000 Network Applied Communication Laboratory, Inc. Copyright (C) 2000 Information-technology Promotion Agency, Japan @@ -557,10 +557,28 @@ extract_elem(path) return extract_path(path, pend); } +static void +remove_backslases(p) + char *p; +{ + char *pend = p + strlen(p); + char *t = p; + + while (p < pend) { + if (*p == '\\') { + *p++; + if (p == pend) break; + } + *t++ = *p++; + } + *t = '\0'; +} + #ifndef S_ISDIR # define S_ISDIR(m) ((m & S_IFMT) == S_IFDIR) #endif + void rb_glob_helper(path, flag, func, arg) char *path; @@ -572,6 +590,7 @@ rb_glob_helper(path, flag, func, arg) char *p, *m; if (!has_magic(path, 0)) { + remove_backslases(path); if (rb_sys_stat(path, &st) == 0) { (*func)(path, arg); } @@ -694,7 +713,14 @@ push_pattern(path, ary) char *path; VALUE ary; { - rb_ary_push(ary, rb_tainted_str_new2(path)); + VALUE str = rb_tainted_str_new2(path); + + if (ary) { + rb_ary_push(ary, str); + } + else { + rb_yield(str); + } } static void @@ -768,10 +794,12 @@ dir_s_glob(dir, str) char buffer[MAXPATHLEN], *buf = buffer; char *t; int nest; - VALUE ary; + VALUE ary = 0; Check_SafeStr(str); - ary = rb_ary_new(); + if (!rb_block_given_p()) { + ary = rb_ary_new(); + } if (RSTRING(str)->len >= MAXPATHLEN) buf = xmalloc(RSTRING(str)->len + 1); @@ -785,6 +813,10 @@ dir_s_glob(dir, str) while (p < pend && !isdelim(*p)) { if (*p == '{') nest+=2; if (*p == '}') nest+=3; + if (*p == '\\') { + *t++ = *p++; + if (p == pend) break; + } *t++ = *p++; } *t = '\0'; @@ -798,14 +830,6 @@ dir_s_glob(dir, str) } if (buf != buffer) free(buf); - if (rb_block_given_p()) { - long len = RARRAY(ary)->len; - VALUE *ptr = RARRAY(ary)->ptr; - - while (len--) { - rb_yield(*ptr++); - } - } return ary; } @@ -6,7 +6,7 @@ $Date$ created at: Tue Jan 18 17:05:06 JST 1994 - Copyright (C) 1993-2000 Yukihiro Matsumoto + Copyright (C) 1993-2001 Yukihiro Matsumoto **********************************************************************/ @@ -6,7 +6,7 @@ $Date$ created at: Wed Jan 19 16:53:09 JST 1994 - Copyright (C) 1993-2000 Yukihiro Matsumoto + Copyright (C) 1993-2001 Yukihiro Matsumoto **********************************************************************/ @@ -6,7 +6,7 @@ $Date$ created at: Mon Jul 11 11:53:03 JST 1994 - Copyright (C) 1993-2000 Yukihiro Matsumoto + Copyright (C) 1993-2001 Yukihiro Matsumoto **********************************************************************/ @@ -6015,7 +6015,7 @@ blk_copy_prev(block) while (block->prev) { tmp = ALLOC_N(struct BLOCK, 1); MEMCPY(tmp, block->prev, struct BLOCK, 1); - if (tmp->frame.argc > 0 && !(tmp->frame.flags & FRAME_MALLOC)) { + if (tmp->frame.argc > 0) { tmp->frame.argv = ALLOC_N(VALUE, tmp->frame.argc); MEMCPY(tmp->frame.argv, block->prev->frame.argv, VALUE, tmp->frame.argc); tmp->frame.flags |= FRAME_MALLOC; @@ -6035,11 +6035,11 @@ frame_dup(frame) struct FRAME *tmp; for (;;) { - if (frame->argc > 0 && !(frame->flags & FRAME_MALLOC)) { + if (frame->argc > 0) { argv = ALLOC_N(VALUE, frame->argc); MEMCPY(argv, frame->argv, VALUE, frame->argc); frame->argv = argv; - frame->flags = FRAME_MALLOC; + frame->flags |= FRAME_MALLOC; } frame->tmp = 0; /* should not preserve tmp */ if (!frame->prev) break; diff --git a/ext/dbm/dbm.c b/ext/dbm/dbm.c index 3744c402e5..7196c18149 100644 --- a/ext/dbm/dbm.c +++ b/ext/dbm/dbm.c @@ -6,7 +6,7 @@ $Date$ created at: Mon Jan 24 15:59:52 JST 1994 - Copyright (C) 1995-1998 Yukihiro Matsumoto + Copyright (C) 1995-2001 Yukihiro Matsumoto ************************************************/ diff --git a/ext/fcntl/fcntl.c b/ext/fcntl/fcntl.c index 80e0112e4c..de0b284b36 100644 --- a/ext/fcntl/fcntl.c +++ b/ext/fcntl/fcntl.c @@ -5,7 +5,7 @@ $Author$ created at: Mon Apr 7 18:53:05 JST 1997 - Copyright (C) 1997-1998 Yukihiro Matsumoto + Copyright (C) 1997-2001 Yukihiro Matsumoto ************************************************/ diff --git a/ext/md5/md5init.c b/ext/md5/md5init.c index a57d5f8f30..c957416229 100644 --- a/ext/md5/md5init.c +++ b/ext/md5/md5init.c @@ -5,7 +5,7 @@ $Author$ created at: Fri Aug 2 09:24:12 JST 1996 - Copyright (C) 1995-1998 Yukihiro Matsumoto + Copyright (C) 1995-2001 Yukihiro Matsumoto ************************************************/ /* This module provides an interface to the RSA Data Security, diff --git a/ext/sdbm/init.c b/ext/sdbm/init.c index 87136e9bdb..d6cda918e4 100644 --- a/ext/sdbm/init.c +++ b/ext/sdbm/init.c @@ -6,7 +6,7 @@ $Date$ created at: Fri May 7 08:34:24 JST 1999 - Copyright (C) 1995-1998 Yukihiro Matsumoto + Copyright (C) 1995-2001 Yukihiro Matsumoto ************************************************/ @@ -6,7 +6,7 @@ $Date$ created at: Mon Nov 22 18:51:18 JST 1993 - Copyright (C) 1993-2000 Yukihiro Matsumoto + Copyright (C) 1993-2001 Yukihiro Matsumoto Copyright (C) 2000 Network Applied Communication Laboratory, Inc. Copyright (C) 2000 Information-technology Promotion Agency, Japan @@ -6,7 +6,7 @@ $Date$ created at: Tue Dec 28 16:01:58 JST 1993 - Copyright (C) 1993-2000 Yukihiro Matsumoto + Copyright (C) 1993-2001 Yukihiro Matsumoto **********************************************************************/ @@ -6,7 +6,7 @@ $Date$ created at: Thu Jun 10 14:22:17 JST 1993 - Copyright (C) 1993-2000 Yukihiro Matsumoto + Copyright (C) 1993-2001 Yukihiro Matsumoto Copyright (C) 2000 Network Applied Communication Laboratory, Inc. Copyright (C) 2000 Information-technology Promotion Agency, Japan @@ -6,7 +6,7 @@ $Date$ created at: Fri Aug 19 13:19:58 JST 1994 - Copyright (C) 1993-2000 Yukihiro Matsumoto + Copyright (C) 1993-2001 Yukihiro Matsumoto **********************************************************************/ @@ -6,7 +6,7 @@ $Date$ created at: Thu Apr 27 16:30:01 JST 1995 - Copyright (C) 1993-2000 Yukihiro Matsumoto + Copyright (C) 1993-2001 Yukihiro Matsumoto **********************************************************************/ @@ -6,7 +6,7 @@ $Date$ created at: Tue Jan 25 14:12:56 JST 1994 - Copyright (C) 1993-2000 Yukihiro Matsumoto + Copyright (C) 1993-2001 Yukihiro Matsumoto **********************************************************************/ @@ -6,7 +6,7 @@ $Date$ created at: Fri May 28 15:14:02 JST 1993 - Copyright (C) 1993-2000 Yukihiro Matsumoto + Copyright (C) 1993-2001 Yukihiro Matsumoto **********************************************************************/ @@ -6,7 +6,7 @@ $Date$ created at: Fri Aug 13 18:33:09 JST 1993 - Copyright (C) 1993-2000 Yukihiro Matsumoto + Copyright (C) 1993-2001 Yukihiro Matsumoto **********************************************************************/ @@ -6,7 +6,7 @@ $Date$ created at: Tue Jan 26 02:40:41 2000 - Copyright (C) 1993-2000 Yukihiro Matsumoto + Copyright (C) 1993-2001 Yukihiro Matsumoto **********************************************************************/ @@ -6,7 +6,7 @@ $Date$ created at: Fri Dec 24 16:39:21 JST 1993 - Copyright (C) 1993-2000 Yukihiro Matsumoto + Copyright (C) 1993-2001 Yukihiro Matsumoto **********************************************************************/ @@ -6,7 +6,7 @@ $Date$ created at: Thu Aug 19 17:46:47 JST 1993 - Copyright (C) 1993-2000 Yukihiro Matsumoto + Copyright (C) 1993-2001 Yukihiro Matsumoto **********************************************************************/ @@ -6,7 +6,7 @@ $Date$ created at: Thu Sep 30 14:18:32 JST 1993 - Copyright (C) 1993-2000 Yukihiro Matsumoto + Copyright (C) 1993-2001 Yukihiro Matsumoto **********************************************************************/ @@ -6,7 +6,7 @@ $Date$ created at: Fri Nov 12 16:47:09 JST 1993 - Copyright (C) 1993-2000 Yukihiro Matsumoto + Copyright (C) 1993-2001 Yukihiro Matsumoto **********************************************************************/ @@ -6,7 +6,7 @@ $Date$ created at: Wed Aug 16 01:15:38 JST 1995 - Copyright (C) 1993-2000 Yukihiro Matsumoto + Copyright (C) 1993-2001 Yukihiro Matsumoto **********************************************************************/ @@ -6,7 +6,7 @@ $Date$ created at: Tue Dec 20 10:13:44 JST 1994 - Copyright (C) 1993-2000 Yukihiro Matsumoto + Copyright (C) 1993-2001 Yukihiro Matsumoto Copyright (C) 2000 Network Applied Communication Laboratory, Inc. Copyright (C) 2000 Information-technology Promotion Agency, Japan @@ -6,7 +6,7 @@ $Date$ created at: Tue Mar 22 18:44:30 JST 1995 - Copyright (C) 1993-2000 Yukihiro Matsumoto + Copyright (C) 1993-2001 Yukihiro Matsumoto **********************************************************************/ @@ -6,7 +6,7 @@ $Date$ created at: Tue Dec 28 14:31:59 JST 1993 - Copyright (C) 1993-2000 Yukihiro Matsumoto + Copyright (C) 1993-2001 Yukihiro Matsumoto **********************************************************************/ @@ -6,7 +6,7 @@ $Date$ created at: Fri Mar 10 17:22:34 JST 1995 - Copyright (C) 1993-2000 Yukihiro Matsumoto + Copyright (C) 1993-2001 Yukihiro Matsumoto **********************************************************************/ @@ -6,7 +6,7 @@ $Date$ created at: Thu Mar 9 11:55:53 JST 1995 - Copyright (C) 1993-2000 Yukihiro Matsumoto + Copyright (C) 1993-2001 Yukihiro Matsumoto **********************************************************************/ diff --git a/variable.c b/variable.c index fae2255908..1c44c1c6d0 100644 --- a/variable.c +++ b/variable.c @@ -6,7 +6,7 @@ $Date$ created at: Tue Apr 19 23:55:15 JST 1994 - Copyright (C) 1993-2000 Yukihiro Matsumoto + Copyright (C) 1993-2001 Yukihiro Matsumoto Copyright (C) 2000 Network Applied Communication Laboratory, Inc. Copyright (C) 2000 Information-technology Promotion Agency, Japan @@ -6,7 +6,7 @@ $Date$ created at: Thu Sep 30 20:08:01 JST 1993 - Copyright (C) 1993-2000 Yukihiro Matsumoto + Copyright (C) 1993-2001 Yukihiro Matsumoto **********************************************************************/ @@ -40,6 +40,6 @@ ruby_show_version() void ruby_show_copyright() { - printf("ruby - Copyright (C) 1993-2000 Yukihiro Matsumoto\n"); + printf("ruby - Copyright (C) 1993-2001 Yukihiro Matsumoto\n"); exit(0); } |