From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#36502: Fwd: bug#36502: 27.0.50; infinite loop in file-name-case-insensitive-p Date: Mon, 08 Jul 2019 16:59:55 +0300 Message-ID: <837e8s7hk4.fsf@gnu.org> References: <7fa570d6-74a7-56d0-af9e-48ade20551b8@cornell.edu> <87muhr47k5.fsf@gmail.com> <837e8v87jf.fsf@gnu.org> <2ffa1b04-e667-f708-1047-d5fc38e72787@cornell.edu> <83v9wd7vwi.fsf@gnu.org> <14115c87-c1e7-6f3d-2694-106a9d4c8706@cornell.edu> <83bly47lxk.fsf@gnu.org> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="229263"; mail-complaints-to="usenet@blaine.gmane.org" Cc: dan@dpsutton.com, npostavs@gmail.com, 36502@debbugs.gnu.org To: Ken Brown Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 08 16:02:34 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hkUDy-000xPa-B8 for geb-bug-gnu-emacs@m.gmane.org; Mon, 08 Jul 2019 16:02:34 +0200 Original-Received: from localhost ([::1]:42010 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hkUDq-0004Oi-IB for geb-bug-gnu-emacs@m.gmane.org; Mon, 08 Jul 2019 10:02:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33724) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hkUCf-0004Kg-LK for bug-gnu-emacs@gnu.org; Mon, 08 Jul 2019 10:01:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hkUCW-0001j0-O5 for bug-gnu-emacs@gnu.org; Mon, 08 Jul 2019 10:01:11 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50455) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hkUCU-0001dg-FI for bug-gnu-emacs@gnu.org; Mon, 08 Jul 2019 10:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hkUCU-00071M-65 for bug-gnu-emacs@gnu.org; Mon, 08 Jul 2019 10:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 08 Jul 2019 14:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36502 X-GNU-PR-Package: emacs Original-Received: via spool by 36502-submit@debbugs.gnu.org id=B36502.156259442826937 (code B ref 36502); Mon, 08 Jul 2019 14:01:02 +0000 Original-Received: (at 36502) by debbugs.gnu.org; 8 Jul 2019 14:00:28 +0000 Original-Received: from localhost ([127.0.0.1]:59276 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkUBw-00070O-Bg for submit@debbugs.gnu.org; Mon, 08 Jul 2019 10:00:28 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:49383) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkUBs-000708-IW for 36502@debbugs.gnu.org; Mon, 08 Jul 2019 10:00:25 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:57675) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hkUBh-0008Pl-Q6; Mon, 08 Jul 2019 10:00:14 -0400 Original-Received: from [176.228.60.248] (port=3568 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hkUBh-0002XR-6o; Mon, 08 Jul 2019 10:00:13 -0400 In-reply-to: (message from Ken Brown on Mon, 8 Jul 2019 13:36: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: 209.51.188.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:162331 Archived-At: > From: Ken Brown > CC: "npostavs@gmail.com" , "dan@dpsutton.com" > , "36502@debbugs.gnu.org" <36502@debbugs.gnu.org> > Date: Mon, 8 Jul 2019 13:36:38 +0000 > > >> if (NILP (default_directory)) > >> - default_directory = BVAR (current_buffer, directory); > >> + { > >> + default_directory = BVAR (current_buffer, directory); > >> + if (NILP (Ffile_name_absolute_p (default_directory))) > >> + default_directory = Qnil; > >> + } > > > > Hmm... why nullify it? Why not simply call expand-file-name > > recursively? > > If the current buffer's default-directory is not absolute, then that variable is > invalid and we can't use it. I'm asking why not do this instead: if (NILP (default_directory)) { default_directory = BVAR (current_buffer, directory); if (NILP (Ffile_name_absolute_p (default_directory))) default_directory = Fexpand_file_name (default_directory, Vinvocation_directory); } Or will the above not work for some reason? > Nullifying it guarantees that the code starting with "if (! STRINGP > (default_directory))" is used. Maybe I should have put in a comment explaining > that. Sure, but this loses information. Of course, if we cannot do better reliably, it's an okay solution. Thanks.