From: matz@... (Yukihiro Matsumoto) Date: 2001-07-25T15:51:05+09:00 Subject: [ruby-talk:18512] Re: File.expand_path is buggy? (PR#158) Hi, In message "File.expand_path is buggy? (PR#158)" on 01/07/24, larsch@cs.auc.dk writes: |File.expand_path has some weird behaviour on my system (1.6.4 and 1.7.1): | |File.expand_path "/foo/bar." # => "/foo/bar" |File.expand_path "/foo/bar.." # => "/foo" |File.expand_path "/foo./bar" # => "/foo/bar" |File.expand_path "/foo../bar" # => "/bar" | |Am I missing something? These are all valid absolute paths. No. It's a bug. --- file.c 2001/07/24 09:02:49 1.41.2.17 +++ file.c 2001/07/25 06:50:05 @@ -1310,2 +1310,7 @@ for ( ; *s; s++) { + while (*s && !isdirsep(*s)) { + *++p = *s++; + if (p >= bend) goto toolong; + } + if (!*s) break; switch (*s) {