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 21:34:22 +0300 Message-ID: <8634op80r5.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> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7534"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 71935@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 04 20:35:24 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 1sPRIi-0001cf-J4 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 04 Jul 2024 20:35:24 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPRIN-0001fr-HX; Thu, 04 Jul 2024 14:35: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 1sPRIK-0001bp-Gr for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2024 14:35:00 -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 1sPRIK-0004ra-6C for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2024 14:35:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sPRIL-0001eX-Ry for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2024 14:35: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 18:35: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.17201180876311 (code B ref 71935); Thu, 04 Jul 2024 18:35:01 +0000 Original-Received: (at 71935) by debbugs.gnu.org; 4 Jul 2024 18:34:47 +0000 Original-Received: from localhost ([127.0.0.1]:42959 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sPRI7-0001dj-Gb for submit@debbugs.gnu.org; Thu, 04 Jul 2024 14:34:47 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:52402) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sPRI2-0001dN-DP for 71935@debbugs.gnu.org; Thu, 04 Jul 2024 14:34:46 -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 1sPRHt-0004n6-JR; Thu, 04 Jul 2024 14:34:33 -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=RWY1RQfoUQwsGjzM60PYjQpWXKDGFxrEga9WhrESB6c=; b=k9Roxwdm0p+m 2U+3GDzbqtOS4J1btN/JM7zNrkfY9BDBp8hv+M1+nYMsQ8VopDVYqcsssAIaJW5/+5w2oXgIA2T9Q HokxdLJbMuTGrk4nRLz6nJgFpIBKNjejyRilOgncvM7uuKWlg1nSMuyxnFBP4n6uJ2c0wLF+xprRu jGLn+hADvcGjHhvSrf9iNdLOpy5DH4oTds+yDxpBZQ9W+Hv5dU8A7IALmV/GBX096dkviGQp1T+Vh 0IJcqUDgv6oT/k9bXdLmxyINtgloE7ltbplZifenTBl36LuO6JNYUP5M7/dKm7VDJuiPe10SN7KwL A6NuGqO1qjAEGo4NSh/Anw==; In-Reply-To: <8634opowlq.fsf@mail.linkov.net> (message from Juri Linkov on Thu, 04 Jul 2024 21:12:01 +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:288391 Archived-At: > From: Juri Linkov > Cc: 71935@debbugs.gnu.org > Date: Thu, 04 Jul 2024 21:12:01 +0300 > > >> >> 1. (setopt dired-listing-switches "-al --block-size='1") > >> >> 2. C-x d /tmp/* > >> > >> This part of insert-directory is used only in case of 1-2 above, > >> i.e. for wildcard '/tmp/*'. In this case the value of 'switches' > >> is "--dired -N -al --block-size='1", and 'shell-quote-argument' > >> returns "--dired\\ -N\\ -al\\ --block-size\\=\\'1" that fails. > > > > I meant to call shell-quote-argument on each option, before they are > > concatenated. > > But switches are never unconcatenated in a list, > they come from the string: > > (setopt dired-listing-switches "-al --block-size='1") If they are a single string, split it with split-string-and-unquote, then concatenate after running each one through shell-quote-argument. If they are a list of strings, quote each one before concatenating with mapconcat.