From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#29231: 26.0.90; invald file name for symbolic files Date: Sat, 11 Nov 2017 10:54:57 +0200 Message-ID: <837euxp53y.fsf@gnu.org> References: , <83efp7qk9i.fsf@gnu.org> , <83wp2ypn4q.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1510390575 12109 195.159.176.226 (11 Nov 2017 08:56:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 11 Nov 2017 08:56:15 +0000 (UTC) Cc: 29231@debbugs.gnu.org To: Vincent Zhang , Alan Third Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Nov 11 09:56:09 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eDRaD-0002mp-Eq for geb-bug-gnu-emacs@m.gmane.org; Sat, 11 Nov 2017 09:56:09 +0100 Original-Received: from localhost ([::1]:44883 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eDRaI-0005UL-13 for geb-bug-gnu-emacs@m.gmane.org; Sat, 11 Nov 2017 03:56:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49729) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eDRaA-0005Tx-FP for bug-gnu-emacs@gnu.org; Sat, 11 Nov 2017 03:56:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eDRa6-0005jg-BZ for bug-gnu-emacs@gnu.org; Sat, 11 Nov 2017 03:56:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54257) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eDRa6-0005jQ-7P for bug-gnu-emacs@gnu.org; Sat, 11 Nov 2017 03:56:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eDRa5-0006N4-Tk for bug-gnu-emacs@gnu.org; Sat, 11 Nov 2017 03:56:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 11 Nov 2017 08:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29231 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 29231-submit@debbugs.gnu.org id=B29231.151039051124423 (code B ref 29231); Sat, 11 Nov 2017 08:56:01 +0000 Original-Received: (at 29231) by debbugs.gnu.org; 11 Nov 2017 08:55:11 +0000 Original-Received: from localhost ([127.0.0.1]:34705 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eDRZH-0006Lr-Iq for submit@debbugs.gnu.org; Sat, 11 Nov 2017 03:55:11 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:58663) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eDRZF-0006Lc-FV for 29231@debbugs.gnu.org; Sat, 11 Nov 2017 03:55:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eDRZ6-0005QG-4j for 29231@debbugs.gnu.org; Sat, 11 Nov 2017 03:55:04 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53735) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eDRZ6-0005QC-11; Sat, 11 Nov 2017 03:55:00 -0500 Original-Received: from [176.228.60.248] (port=1812 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eDRZ3-0004kg-9k; Sat, 11 Nov 2017 03:54:58 -0500 In-reply-to: (message from Vincent Zhang on Fri, 10 Nov 2017 10:10:38 +0000) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:139746 Archived-At: > From: Vincent Zhang > CC: "29231@debbugs.gnu.org" <29231@debbugs.gnu.org> > Date: Fri, 10 Nov 2017 10:10:38 +0000 > > Steps: > 1. Start GNU Emacs 26.0.90 GUI via `Emacs -Q' on macOS 10.13.1. > 2. Create some symbolic files (e.g. ~/.zshrc -> ~/.dotfiles/.zshrc) in the home folders. > 3. Enable `ido-mode`, and `find-file` to open the symbolic files (~/.zshrc). > > Results: > `~/.zshrc/` is showed in minibuffer after pressing `TAB`, and Emacs treats it as a folder and create a new > one. > In Emacs 25, only `~/.zshrc` is showed, and Emacs gives a prompt of opening a symbolic file. > > Am I missing anything? It's a macOS specific bug. Alan, I think the problem might be in the macOS implementation of faccessat, called here: /* Return true if in the directory FD the directory entry DP, whose string length is LEN, is that of a subdirectory that can be searched. */ static bool file_name_completion_dirp (int fd, struct dirent *dp, ptrdiff_t len) { USE_SAFE_ALLOCA; char *subdir_name = SAFE_ALLOCA (len + 2); memcpy (subdir_name, dp->d_name, len); strcpy (subdir_name + len, "/"); bool dirp = faccessat (fd, subdir_name, F_OK, AT_EACCESS) == 0; SAFE_FREE (); return dirp; } This assumes that calling faccessat with an argument "foo/" will return zero (i.e. succeed) only if "foo" is a directory, but will fail (return non-zero) if it's a file. I'm guessing that on macOS, this call succeeds even for files, or maybe just for symlinks to files. Could you (or someone else) please look into that? I don't have access to a macOS system. Btw, does macOS have faccessat, or does it use the Gnulib replacement?