diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-03-27 07:10:58 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-03-27 07:10:58 +0000 |
commit | b0cc7e80a6471c5a38e327a6f20a38ad8f406d39 (patch) | |
tree | 48b6aa490841427277d779379813080fd49e38f3 /dir.c | |
parent | 97101e1a65cdea02e26cfa0e752d62bb87f6b162 (diff) |
* eval.c (rb_mod_define_method): should have clear method cache.
* eval.c (rb_mod_define_method): should have raised exception for
type error.
* ruby.h: changed "extern INLINE" to "static inline".
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r-- | dir.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -609,7 +609,7 @@ rb_glob_helper(path, flag, func, arg) rb_glob_helper(buf, flag, func, arg); free(buf); } - if (lstat(dir, &st) < 0) { + if (stat(dir, &st) < 0) { free(base); break; } @@ -637,7 +637,15 @@ rb_glob_helper(path, flag, func, arg) continue; buf = ALLOC_N(char, strlen(base)+NAMLEN(dp)+strlen(m)+6); sprintf(buf, "%s%s%s/**%s", base, (BASE)?"/":"", dp->d_name, m); - rb_glob_helper(buf, flag, func, arg); + sprintf(buf, "%s%s%s", base, (BASE)?"/":"", dp->d_name); + if (lstat(buf, &st) < 0) { + continue; + } + if (S_ISDIR(st.st_mode)) { + strcat(buf, "/**"); + strcat(buf, m); + rb_glob_helper(buf, flag, func, arg); + } free(buf); continue; } @@ -659,7 +667,7 @@ rb_glob_helper(path, flag, func, arg) free(base); free(magic); while (link) { - lstat(link->path, &st); /* should success */ + stat(link->path, &st); /* should success */ if (S_ISDIR(st.st_mode)) { int len = strlen(link->path); int mlen = strlen(m); |