GNU bug report logs -
#71935
split-string-and-unquote mishandles dired-listing-switches with '
Previous Next
Reported by: Juri Linkov <juri <at> linkov.net>
Date: Thu, 4 Jul 2024 07:02:01 UTC
Severity: normal
Fixed in version 30.0.60
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> From: Juri Linkov <juri <at> linkov.net>
> Cc: 71935 <at> 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.
This bug report was last modified 1 year and 11 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.