summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog26
-rw-r--r--array.c2
-rw-r--r--bignum.c2
-rw-r--r--class.c2
-rw-r--r--compar.c2
-rw-r--r--dir.c48
-rw-r--r--dln.c2
-rw-r--r--dln.h2
-rw-r--r--env.h2
-rw-r--r--eval.c6
-rw-r--r--ext/dbm/dbm.c2
-rw-r--r--ext/fcntl/fcntl.c2
-rw-r--r--ext/md5/md5init.c2
-rw-r--r--ext/sdbm/init.c2
-rw-r--r--hash.c2
-rw-r--r--inits.c2
-rw-r--r--intern.h2
-rw-r--r--main.c2
-rw-r--r--marshal.c2
-rw-r--r--math.c2
-rw-r--r--node.h2
-rw-r--r--numeric.c2
-rw-r--r--prec.c2
-rw-r--r--random.c2
-rw-r--r--range.c2
-rw-r--r--re.h2
-rw-r--r--rubyio.h2
-rw-r--r--rubysig.h2
-rw-r--r--signal.c2
-rw-r--r--struct.c2
-rw-r--r--time.c2
-rw-r--r--util.c2
-rw-r--r--util.h2
-rw-r--r--variable.c2
-rw-r--r--version.c4
35 files changed, 98 insertions, 48 deletions
diff --git a/ChangeLog b/ChangeLog
index b0f28ba381..fef4067aee 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/array.c b/array.c
index 93b3659d06..768b7e8ffe 100644
--- a/array.c
+++ b/array.c
@@ -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
diff --git a/bignum.c b/bignum.c
index e342989da8..39d90aa92d 100644
--- a/bignum.c
+++ b/bignum.c
@@ -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
**********************************************************************/
diff --git a/class.c b/class.c
index 2eedb262dc..b8d2cbca96 100644
--- a/class.c
+++ b/class.c
@@ -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
**********************************************************************/
diff --git a/compar.c b/compar.c
index 3cebc30a80..6ae4b1af40 100644
--- a/compar.c
+++ b/compar.c
@@ -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
**********************************************************************/
diff --git a/dir.c b/dir.c
index 2c93e33017..2c3212081a 100644
--- a/dir.c
+++ b/dir.c
@@ -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;
}
diff --git a/dln.c b/dln.c
index a98a44c517..a64b408b03 100644
--- a/dln.c
+++ b/dln.c
@@ -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
**********************************************************************/
diff --git a/dln.h b/dln.h
index 940d82c414..d3707b38c1 100644
--- a/dln.h
+++ b/dln.h
@@ -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
**********************************************************************/
diff --git a/env.h b/env.h
index 2ec325efa4..8e96f1a7f7 100644
--- a/env.h
+++ b/env.h
@@ -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
**********************************************************************/
diff --git a/eval.c b/eval.c
index e8a22def7a..0323c9fbbe 100644
--- a/eval.c
+++ b/eval.c
@@ -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
************************************************/
diff --git a/hash.c b/hash.c
index ce46f406af..57debb7c51 100644
--- a/hash.c
+++ b/hash.c
@@ -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
diff --git a/inits.c b/inits.c
index 7f0074e6ae..d3fffb654e 100644
--- a/inits.c
+++ b/inits.c
@@ -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
**********************************************************************/
diff --git a/intern.h b/intern.h
index 58e39c705f..d0253df025 100644
--- a/intern.h
+++ b/intern.h
@@ -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
diff --git a/main.c b/main.c
index 9e2c05ceae..ef1b495d9c 100644
--- a/main.c
+++ b/main.c
@@ -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
**********************************************************************/
diff --git a/marshal.c b/marshal.c
index 28b0ab1d6c..a7b13ef1a0 100644
--- a/marshal.c
+++ b/marshal.c
@@ -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
**********************************************************************/
diff --git a/math.c b/math.c
index ac87b9c8dc..a676abf45f 100644
--- a/math.c
+++ b/math.c
@@ -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
**********************************************************************/
diff --git a/node.h b/node.h
index 658941a723..c906aa7c4e 100644
--- a/node.h
+++ b/node.h
@@ -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
**********************************************************************/
diff --git a/numeric.c b/numeric.c
index 0dd86f0532..8e372694e0 100644
--- a/numeric.c
+++ b/numeric.c
@@ -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
**********************************************************************/
diff --git a/prec.c b/prec.c
index fab5ea3899..d30969b3a8 100644
--- a/prec.c
+++ b/prec.c
@@ -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
**********************************************************************/
diff --git a/random.c b/random.c
index 5ac7868bf1..4e9213ebc4 100644
--- a/random.c
+++ b/random.c
@@ -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
**********************************************************************/
diff --git a/range.c b/range.c
index 2ad20df83d..627c704c77 100644
--- a/range.c
+++ b/range.c
@@ -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
**********************************************************************/
diff --git a/re.h b/re.h
index e38dcb7f3b..ec041f6b17 100644
--- a/re.h
+++ b/re.h
@@ -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
**********************************************************************/
diff --git a/rubyio.h b/rubyio.h
index 00d55baea1..6509e3e7c1 100644
--- a/rubyio.h
+++ b/rubyio.h
@@ -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
**********************************************************************/
diff --git a/rubysig.h b/rubysig.h
index 1975215ef0..a2f6c2c10f 100644
--- a/rubysig.h
+++ b/rubysig.h
@@ -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
**********************************************************************/
diff --git a/signal.c b/signal.c
index 2bb8bada28..3ec0946471 100644
--- a/signal.c
+++ b/signal.c
@@ -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
diff --git a/struct.c b/struct.c
index 06db22d550..9de9915493 100644
--- a/struct.c
+++ b/struct.c
@@ -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
**********************************************************************/
diff --git a/time.c b/time.c
index e45e2e854a..9acc00f7a6 100644
--- a/time.c
+++ b/time.c
@@ -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
**********************************************************************/
diff --git a/util.c b/util.c
index 46fcf0ba79..5a1d3c7644 100644
--- a/util.c
+++ b/util.c
@@ -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
**********************************************************************/
diff --git a/util.h b/util.h
index 4a08f22bfa..09fa410f67 100644
--- a/util.h
+++ b/util.h
@@ -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
diff --git a/version.c b/version.c
index a5692ffa4f..09569e9d7b 100644
--- a/version.c
+++ b/version.c
@@ -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);
}