[#26942] core dump with ripper — Tanaka Akira <akr@...17n.org>
ripper で次のように core を吐くことがあるようです。
[#26952] ripper problems. — Tanaka Akira <akr@...17n.org>
ついでに、
[#26954] Re: core dump with ripper — Yukihiro Matsumoto <matz@...>
まつもと ゆきひろです
[#26962] Re: about Ruby-GetText — Yukihiro Matsumoto <matz@...>
まつもと ゆきひろです
[#26963] sprintf does not warn in verbose mode. — sheepman <sheepman@...>
こんにちは、sheepman です。
[#26975] [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
山本です。
まつもと ゆきひろです
山本です。
なかだです。
山本です。
まつもと ゆきひろです
山本です。
山本です。
山本です。
まつもと ゆきひろです
山本です。
山本です。
まつもと ゆきひろです
山本です。
In message <20050909220539.E1B26BB8.ocean@m2.ccsnet.ne.jp>
山本です。
山本です。
まつもと ゆきひろです
山本です。
山本です。
まつもと ゆきひろです
山本です。
まつもと ゆきひろです
山本です。
まつもと ゆきひろです
山本です。
山本です。
山本です。
山本です。
まつもと ゆきひろです
山本です。
山本です。
なかだです。
[#26984] elimination of "extern int errno;" — Takahiro Kambe <taca@...>
こんにちは。
In message <20050908.120716.71112483.taca@back-street.net>
まつもと ゆきひろです
In message <1126489480.743964.31599.nullmailer@x31.priv.netlab.jp>
In message <20050912.104954.92585084.taca@back-street.net>
まつもと ゆきひろです
In article <1126491408.019719.1052.nullmailer@x31.priv.netlab.jp>,
In message <87wtlmyasi.fsf@m17n.org>
In article <20050916.201819.92561710.taca@back-street.net>,
In message <878xxx6tab.fsf@m17n.org>
こんにちは、なかむら(う)です。
まつもと ゆきひろです
高橋征義です。
まつもと ゆきひろです
高橋征義です。
山本です。
永井@知能.九工大です.
山本です。
永井@知能.九工大です.
山本です。
永井@知能.九工大です.
[#27051] fail on test/rss — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
山本です。
なかだです。
まつもと ゆきひろです
まつもと ゆきひろです
まつもと ゆきひろです
[#27123] test/socket/test_tcp.rb blocks on NetBSD — Tanaka Akira <akr@...17n.org>
2005-09-16 から NetBSD で test/socket/test_tcp.rb がブロックするようになっています。
[#27139] ruby-1.8.3 status for release — Masayoshi Takahashi <maki@...>
高橋征義です。
卜部です。
卜部です。
こんにちは、sheepman です。
小西 弘将です。
Masayoshi Takahashi wrote:
助田です。
高橋征義です。
山本です。
こんにちは、なかむら(う)です。
かわじ、です。
山本です。
卜部です。
[#27140] [PATCH] File#chown(nil, nil) — Minero Aoki <aamine@...>
青木です。
[#27141] Interix3 (SFU)サポート — Takahiro Kambe <taca@...>
おはようございます。
[#27150] test_readline.rb blocks on NetBSD. — Tanaka Akira <akr@...17n.org>
NetBSD で、ひさしぶりに端末から ruby を build したところ、test-all 中
前田です。
[#27242] Ruby 1.8.3 released — Yukihiro Matsumoto <matz@...>
Hello Rubyists,
[#27248] glob from command line still broken in djgpp? — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
山本です。
[#27251] 脆弱性レポート翻訳者募集 — Yukihiro Matsumoto <matz@...>
まつもと ゆきひろです
In message <1127268581.886018.27376.nullmailer@x31.priv.netlab.jp>
[#27275] release schedule plan for 1.8.4 — "NARUSE, Yui" <naruse@...>
成瀬です。
[#27281] env -i make; fails. — "URABE Shyouhei aka.mput" <root@...>
うらべです。
なかだです。
In article <TYOMLEM041XvpFVjCRG00000109@tyomlvem02.e2k.ad.ge.com>,
なかだです。
In article <TYOMLEM04ryWtIIZS2T0000010a@tyomlvem02.e2k.ad.ge.com>,
[#27297] warning of yaml/basenode.rb — 雪見酒 <yukimi_sake@...>
こちらでははじめまして、雪見酒です。
[#27302] warning: 'cdecl' attribute directive ignored — Kazuhiro NISHIYAMA <zn@...>
西山和広です。
[#27321] RubyGemsとOS platformとの関係 — Daigo Moriwaki <techml@...>
こんにちは、森脇です。
なかだです。
まつもと ゆきひろです
西尾瑞穂 と言います。
まつもと ゆきひろです
In article <1127872084.608903.6359.nullmailer@x31.priv.netlab.jp>,
まつもと ゆきひろです
森脇です。
Daigo Moriwaki wrote:
In article <433CC31E.20802@ruby-lang.org>,
Tanaka Akira wrote:
まつもと ゆきひろです
In article <433D4CED.9030005@ruby-lang.org>,
Tanaka Akira wrote:
In article <433E4AF0.5020308@ruby-lang.org>,
[#27324] ext/digest on DrafonFly — Takahiro Kambe <taca@...>
こんにちは。
[#27331] possible SEGV in rb_autoload_load? — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
山本です。
[#27334] File#read にゴミがつく — Yusuke ENDOH <mame@...>
はじめまして、遠藤侑介と申します。
なかだです。
[ruby-dev:27068] Re: fail on make install
なかだです。
At Thu, 1 Sep 2005 21:42:00 +0900,
U.Nakamura wrote in [ruby-dev:26940]:
> (1) 元々、glob はインタプリタから独立して動くようになっていて、
> (2) それがインタプリタに依存するようになって、
> (3) win32 で glob を呼ぶタイミングを ruby_init の後にしたら、
> (4) ruby を組み込む人たちからいろいろ問題が報告されて、
> (5) 仕方がないので ruby_init の前に戻したら、
> (6) いつの間にかまた glob が動かなくなっていた。
>
> ということだと思うんですが、(2)の変更の理由は覚えてないし、(6)
> がなぜ起こったのかも把握してません。
(2)は、Dir.globのブロックの中で例外が起きたりしたときのために、
リソースをVALUEで管理しようとしたためです。
> とりあえず、(6)はなんでなのかご存知のひとー?
rb_protect()内部のコンテキストをcallccで外部から呼び出せないよ
うにするために、オブジェクトをマークとして割り当てるようにしま
した。これがruby_init前に起きるとGCが呼ばれることになります。
それともう一つ、(5)のときの修正漏れですが、rb_glob_caller()の引
数が呼び出し側とあっていないために、ここでもエラーになるか正し
くない結果になります。
たしかにfnmatch()とは無関係なので、名前を変えて外部からは指定で
きないようにしました。
Index: dir.c
===================================================================
RCS file: /cvs/ruby/src/ruby/dir.c,v
retrieving revision 1.144
diff -U2 -p -u -r1.144 dir.c
--- dir.c 12 Sep 2005 10:44:19 -0000 1.144
+++ dir.c 14 Sep 2005 04:41:27 -0000
@@ -891,10 +891,13 @@ dir_s_rmdir(VALUE obj, VALUE dir)
}
+#define GLOB_VERBOSE (1 << (sizeof(int) * CHAR_BIT - 1))
+
/* System call with warning */
static int
-do_stat(const char *path, struct stat *pst)
+do_stat(const char *path, struct stat *pst, int flags)
+
{
int ret = stat(path, pst);
- if (ret < 0 && errno != ENOENT)
+ if (ret < 0 && (flags & GLOB_VERBOSE) && errno != ENOENT)
rb_protect((VALUE (*)_((VALUE)))rb_sys_warning, (VALUE)path, 0);
@@ -903,8 +906,8 @@ do_stat(const char *path, struct stat *p
static int
-do_lstat(const char *path, struct stat *pst)
+do_lstat(const char *path, struct stat *pst, int flags)
{
int ret = lstat(path, pst);
- if (ret < 0 && errno != ENOENT)
+ if (ret < 0 && (flags & GLOB_VERBOSE) && errno != ENOENT)
rb_protect((VALUE (*)_((VALUE)))rb_sys_warning, (VALUE)path, 0);
@@ -913,8 +916,8 @@ do_lstat(const char *path, struct stat *
static DIR *
-do_opendir(const char *path)
+do_opendir(const char *path, int flags)
{
DIR *dirp = opendir(path);
- if (dirp == NULL && errno != ENOENT && errno != ENOTDIR)
+ if (!dirp && (flags & GLOB_VERBOSE) && errno != ENOENT && errno != ENOTDIR)
rb_protect((VALUE (*)_((VALUE)))rb_sys_warning, (VALUE)path, 0);
@@ -1119,17 +1122,5 @@ glob_func_caller(VALUE val)
}
-static int
-glob_call_func(void (*func) (const char *, VALUE), const char *path, VALUE arg)
-{
- int status;
- struct glob_args args;
-
- args.func = func;
- args.c = path;
- args.v = arg;
-
- rb_protect(glob_func_caller, (VALUE)&args, &status);
- return status;
-}
+#define glob_call_func(func, path, arg) (*func)(path, arg)
static int
@@ -1142,5 +1133,5 @@ glob_helper(
struct glob_pattern **end,
int flags,
- void (*func) (const char *, VALUE),
+ int (*func)(const char *, VALUE),
VALUE arg)
{
@@ -1177,5 +1168,5 @@ glob_helper(
if (*path) {
if (match_all && exist == UNKNOWN) {
- if (do_lstat(path, &st) == 0) {
+ if (do_lstat(path, &st, flags) == 0) {
exist = YES;
isdir = S_ISDIR(st.st_mode) ? YES : S_ISLNK(st.st_mode) ? UNKNOWN : NO;
@@ -1187,5 +1178,5 @@ glob_helper(
}
if (match_dir && isdir == UNKNOWN) {
- if (do_stat(path, &st) == 0) {
+ if (do_stat(path, &st, flags) == 0) {
exist = YES;
isdir = S_ISDIR(st.st_mode) ? YES : NO;
@@ -1212,5 +1203,5 @@ glob_helper(
if (magical || recursive) {
struct dirent *dp;
- DIR *dirp = do_opendir(*path ? path : ".");
+ DIR *dirp = do_opendir(*path ? path : ".", flags);
if (dirp == NULL) return 0;
@@ -1222,5 +1213,5 @@ glob_helper(
&& fnmatch("*", dp->d_name, flags) == 0) {
#ifndef _WIN32
- if (do_lstat(buf, &st) == 0)
+ if (do_lstat(buf, &st, flags) == 0)
new_isdir = S_ISDIR(st.st_mode) ? YES : S_ISLNK(st.st_mode) ? UNKNOWN : NO;
else
@@ -1294,5 +1285,5 @@ glob_helper(
static int
-rb_glob2(const char *path, int flags, void (*func) (const char *, VALUE), VALUE arg)
+ruby_glob0(const char *path, int flags, int (*func)(const char *, VALUE), VALUE arg)
{
struct glob_pattern *list;
@@ -1302,8 +1293,4 @@ rb_glob2(const char *path, int flags, vo
int status;
- if (flags & FNM_CASEFOLD) {
- rb_warn("Dir.glob() ignores File::FNM_CASEFOLD");
- }
-
start = root = path;
#if defined DOSISH
@@ -1329,26 +1316,41 @@ rb_glob2(const char *path, int flags, vo
}
-struct rb_glob_args {
- void (*func) _((const char*, VALUE));
- VALUE arg;
-};
+int
+ruby_glob(const char *path, int flags, int (*func)(const char *, VALUE), VALUE arg)
+{
+ return ruby_glob0(path, flags & ~GLOB_VERBOSE, func, arg);
+}
-static void
+static int
rb_glob_caller(const char *path, VALUE a)
{
- struct rb_glob_args *args = (struct rb_glob_args *)a;
- (*args->func)(path, args->arg);
+ int status;
+ struct glob_args *args = (struct glob_args *)a;
+
+ args->c = path;
+ rb_protect(glob_func_caller, a, &status);
+ return status;
}
-void
-rb_glob(const char *path, void (*func) (const char *, VALUE), VALUE arg)
+static int
+rb_glob2(const char *path, int flags, void (*func)(const char *, VALUE), VALUE arg)
{
- struct rb_glob_args args;
+ struct glob_args args;
int status;
args.func = func;
- args.arg = arg;
- status = rb_glob2(path, 0, rb_glob_caller, (VALUE)&args);
+ args.v = arg;
+ if (flags & FNM_CASEFOLD) {
+ rb_warn("Dir.glob() ignores File::FNM_CASEFOLD");
+ }
+
+ return ruby_glob0(path, flags | GLOB_VERBOSE, rb_glob_caller, (VALUE)&args);
+}
+
+void
+rb_glob(const char *path, void (*func) (const char *, VALUE), VALUE arg)
+{
+ int status = rb_glob2(path, 0, func, arg);
if (status) rb_jump_tag(status);
}
--
--- 僕の前にBugはない。
--- 僕の後ろにBugはできる。
中田 伸悦