From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 8EB9A20248 for ; Sat, 30 Mar 2019 14:06:20 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id A0F73120C4D; Sat, 30 Mar 2019 23:06:15 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id 6FE6D120AB0 for ; Sat, 30 Mar 2019 23:06:13 +0900 (JST) Received: by filter0194p3mdw1.sendgrid.net with SMTP id filter0194p3mdw1-24339-5C9F77D3-2A 2019-03-30 14:06:11.794388001 +0000 UTC m=+234921.584751175 Received: from herokuapp.com (unknown [3.85.129.45]) by ismtpd0002p1iad1.sendgrid.net (SG) with ESMTP id NzXn3_XUSEWIOdmhTAPwaw for ; Sat, 30 Mar 2019 14:06:11.779 +0000 (UTC) Date: Sat, 30 Mar 2019 14:06:11 +0000 (UTC) From: naruse@airemix.jp Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 67543 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15649 X-Redmine-Issue-Author: daniel-rikowski X-Redmine-Sender: naruse X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: =?us-ascii?Q?UqoG4vcRhHM9V1I4f4J7DhjzUfTg+8muXbMD6UD+LVQTbiQUW+wcisWAsxk+QP?= =?us-ascii?Q?fFmZixg766UOLrK39eOhWnLzln3yGsgVQ6IP1tZ?= =?us-ascii?Q?F35hFejwdmBYNyfyI2xbNyDN+WQPzyvbCYxIY=2FB?= =?us-ascii?Q?I41Vgi+d3GXACIDzYG5HkLZIO6Sx+eVALbQfKWi?= =?us-ascii?Q?=2FmF2CrEry7Q9zcRn6ApUFsE=2FA2RJ6nux46A=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 92057 Subject: [ruby-core:92057] [Ruby trunk Bug#15649] Dir.glob regression with braces and Windows drive letters X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #15649 has been updated by naruse (Yui NARUSE). Backport changed from 2.4: DONTNEED, 2.5: DONTNEED, 2.6: REQUIRED to 2.4: DONTNEED, 2.5: DONTNEED, 2.6: DONE ruby_2_6 r67353 merged revision(s) 67332. ---------------------------------------- Bug #15649: Dir.glob regression with braces and Windows drive letters https://bugs.ruby-lang.org/issues/15649#change-77379 * Author: daniel-rikowski (Daniel Rikowski) * Status: Closed * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.6.1p33 (2019-01-30 revision 66950) [x64-mingw32] * Backport: 2.4: DONTNEED, 2.5: DONTNEED, 2.6: DONE ---------------------------------------- I noticed that certain glob patterns involving braces and drive letters, which did work in Ruby 2.5.3, no longer work in Ruby 2.6.1. Assume I have a directory `C:\Projects` and my current directory is `C:\Windows`. Using IRB I can observe the following results of `Dir.glob`: Patterns working in 2.6.1 and 2.5.3: ``` Dir['c:'] => ['c:'] Dir['c:/'] => ['c:/'] Dir['c:/projects'] => ['c:/Projects'] ``` Patterns broken in 2.6.1 (but working in 2.5.3) ``` Dir['{c:}'] => ['Windows'] Dir['{c:/}'] => ['Windows/'] Dir['{c:/projects}'] => [] ``` Some background: I noticed this problem first in Rails, where the file modification watcher tries to glob a pattern like `{c:/dir1/**/*.{rb},c:/dir2/**/*.{rb},c:/dir3/**/*.{rb}}` Due to the bug above, the code reloading feature of Rails is broken using Ruby 2.6.1 on Windows. (Because the pattern is always resolved to an empty array) Rubies tested: * ruby 2.5.3p105 (2018-10-18 revision 65156) [x64-mingw32] * ruby 2.6.1p33 (2019-01-30 revision 66950) [x64-mingw32] ---Files-------------------------------- 0001-dir.c-fix-Dir.glob-starts-with-brace.patch (2.46 KB) -- https://bugs.ruby-lang.org/