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=-3.9 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,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 9314E1F461 for ; Mon, 2 Sep 2019 06:50:49 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 9DACA120B6F; Mon, 2 Sep 2019 15:50:42 +0900 (JST) Received: from o1678916x28.outbound-mail.sendgrid.net (o1678916x28.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 5699E120B66 for ; Mon, 2 Sep 2019 15:50:41 +0900 (JST) Received: by filter0034p3las1.sendgrid.net with SMTP id filter0034p3las1-337-5D6CBBC3-3 2019-09-02 06:50:43.076178774 +0000 UTC m=+555643.798116631 Received: from herokuapp.com (unknown [54.242.66.142]) by ismtpd0037p1mdw1.sendgrid.net (SG) with ESMTP id 2Vv-SJloQIyh8gRKu76gyg for ; Mon, 02 Sep 2019 06:50:42.962 +0000 (UTC) Date: Mon, 02 Sep 2019 06:50:43 +0000 (UTC) From: matz@ruby.or.jp Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 70288 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15244 X-Redmine-Issue-Author: TiSer X-Redmine-Sender: matz 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?bXEIHGfdFwsIlBTndiToCp=2Fmc2rfxRD2sZAksRKJIHWb4bMZtN0Z0yOA3tzs+U?= =?us-ascii?Q?OjbTIs73+UJPedC6ta+zkBBHeamK8jNxktTO9=2FJ?= =?us-ascii?Q?rKv5EQmwlF6DTcdRQ2Lf3Kg6HCQYqqPgBInFj1W?= =?us-ascii?Q?QZzunWtKVYAheYJCrrd3UPABgFqLxV5iibQd2pk?= =?us-ascii?Q?8ShTmZ8KqlWsN?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 94734 Subject: [ruby-core:94734] [Ruby master Bug#15244] Method #extname return empty string if filename is dot ('.') 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 #15244 has been updated by matz (Yukihiro Matsumoto). Status changed from Open to Feedback `.git` is not an extension but a filename. `.a.jpg` has `.jpg` extension. I wonder how we can parse `..jpg`. It's undefined behavior for me. Any reasoning? Matz. ---------------------------------------- Bug #15244: Method #extname return empty string if filename is dot ('.') https://bugs.ruby-lang.org/issues/15244#change-81350 * Author: TiSer (Sergey TiSer) * Status: Feedback * Priority: Normal * Assignee: * Target version: * ruby -v: 2.7.0dev * Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN ---------------------------------------- ### Example 1: Current behaviour: ``` File.extname('..jpg') => "" ``` Expected behaviour: ``` File.extname('..jpg') => ".jpg" ``` ### Example 2: Current behaviour: ``` File.extname('....jpg') => "" ``` Expected behaviour: ``` => ".jpg" ``` ---Files-------------------------------- dot-names.diff (891 Bytes) multiple-leading-dot-basename-extname-15244.patch (1.94 KB) -- https://bugs.ruby-lang.org/