From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#71935: split-string-and-unquote mishandles dired-listing-switches with ' Date: Thu, 04 Jul 2024 22:11:27 +0300 Message-ID: <86tth56kgw.fsf@gnu.org> References: <86tth5tztt.fsf@mail.linkov.net> <86zfqx8tnn.fsf@gnu.org> <86a5ixqhd4.fsf@mail.linkov.net> <868qyh82is.fsf@gnu.org> <8634opowlq.fsf@mail.linkov.net> <8634op80r5.fsf@gnu.org> <86tth52dkl.fsf@mail.linkov.net> <86wmm16kuz.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11224"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 71935@debbugs.gnu.org To: juri@linkov.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 04 21:13:16 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sPRtL-0002lb-Q1 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 04 Jul 2024 21:13:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPRt9-00073E-Kq; Thu, 04 Jul 2024 15:13:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPRt6-00072I-UN for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2024 15:13:01 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sPRt6-0005EW-En for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2024 15:13:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sPRt7-0002gB-Tw for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2024 15:13:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 04 Jul 2024 19:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71935 X-GNU-PR-Package: emacs Original-Received: via spool by 71935-submit@debbugs.gnu.org id=B71935.172012032510205 (code B ref 71935); Thu, 04 Jul 2024 19:13:01 +0000 Original-Received: (at 71935) by debbugs.gnu.org; 4 Jul 2024 19:12:05 +0000 Original-Received: from localhost ([127.0.0.1]:43000 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sPRsD-0002eW-7J for submit@debbugs.gnu.org; Thu, 04 Jul 2024 15:12:05 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:55146) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sPRsB-0002dv-6i for 71935@debbugs.gnu.org; Thu, 04 Jul 2024 15:12:03 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPRs1-0003fp-UO; Thu, 04 Jul 2024 15:11:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Q+5mBKgKHSC1Ck9BtM0DJ8JgFvJyj0AYYDHI8xg58xw=; b=ns55WOYn/l34 UoGlGmv0OTs8k6A5p1W9LXwW/mU9tlAopqlqxr1N5btu7Wcl4sNdsYHD8QpgCRUODLVCO0+NBHmfE vbXW+aPtZAfld6gKleId1DPOLwD0RdS28aAuGfyj1xQskKvNdygnQgo46B65EdolfZjSM+cPdUlX6 Vt3sIQxAoejq9wFYTw5qTn5qhmqZCkqI2KJBqhU8gfR6WTj9GsbsNttR5GRtKro5NaxRpC2YXD6Gj r6sglHcJ9iQZRHJiedxK92QZ++kbfWxro2HgmWlTgjcCm+rdJ/Rs7T3HAeublYpP9hRqCAywBTiQ8 jtVQhoWjHb5fVO4DMGqZ7Q==; In-Reply-To: <86wmm16kuz.fsf@gnu.org> (message from Eli Zaretskii on Thu, 04 Jul 2024 22:03:00 +0300) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:288395 Archived-At: > Cc: 71935@debbugs.gnu.org > Date: Thu, 04 Jul 2024 22:03:00 +0300 > From: Eli Zaretskii > > > diff --git a/lisp/files.el b/lisp/files.el > > index 042b8e2d515..6ed07f02890 100644 > > --- a/lisp/files.el > > +++ b/lisp/files.el > > @@ -8195,9 +8193,11 @@ insert-directory > > "\\") ; Disregard Unix shell aliases! > > insert-directory-program > > " -d " > > - (if (stringp switches) > > - switches > > - (mapconcat #'identity switches " ")) > > + (mapconcat #'shell-quote-argument > > + (if (stringp switches) > > + (split-string-and-unquote switches) > > + switches) > > + " ") > > " -- " > > ;; Quote some characters that have > > ;; special meanings in shells; but > > > > Thanks, that's what I had in mind. Please install on the emacs-30 > branch. On second thought: could there be options that include shell wildcards, which therefore should not be quoted? If so, perhaps instead of shell-quote-argument we should use shell-quote-wildcard-pattern?