< :前の番号
^ :番号順リスト
> :次の番号
P :前の記事(スレッド移動)
N :次の記事(スレッド移動)
|<:前のスレッド
>|:次のスレッド
^ :返事先
_:自分への返事
>:同じ返事先を持つ記事(前)
<:同じ返事先を持つ記事(後)
---:分割してスレッド表示、再表示
| :分割して(縦)スレッド表示、再表示
~ :スレッドのフレーム消去
.:インデックス
..:インデックスのインデックス
Issue #17280 has been updated by Eregon (Benoit Daloze).
Thanks, that looks good to me.
I think everyone expects FNM_DOTMATCH to match dotfiles, and `.` and `..` are not dotfiles.
Or is there is some other purpose for FNM_DOTMATCH?
----------------------------------------
Bug #17280: Dir.glob with FNM_DOTMATCH matches ".." and "." and results in duplicated entries
https://bugs.ruby-lang.org/issues/17280#change-88599
* Author: Eregon (Benoit Daloze)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-linux]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
```
% ruby -e 'p Dir.glob("**/*", File::FNM_DOTMATCH)'
[".", "bar", "bar/.", "bar/.baz", "bar/.baz/.", "bar/.baz/qux"]
% ruby -e 'p Dir.glob("**", File::FNM_DOTMATCH)'
[".", "..", "bar"]
% ruby -e 'p Dir.glob("*", File::FNM_DOTMATCH)'
[".", "..", "bar"]
```
I think `".."` was never intended by the user here, is it a bug?
Not sure about `"."`.
Note it also causes duplicated entries: `bar and bar/.baz` are twice in the Array!
I think `..` should always be ignored for glob purposes, it escapes the current directory.
And `.` seems useless and causing duplicates.
I think the intention of users of `File::FNM_DOTMATCH` is to match file/directories starting with a `.` like `.baz`.
Probably `Dir.glob("**/{*,.*}")` is a safer way to achieve that,
but still I think `FNM_DOTMATCH` should not produce such weird results.
From https://github.com/oracle/truffleruby/issues/2116
I could not figure out what was the intended semantics for FNM_DOTMATCH with regards to `.` and `..`.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>