zsh-workers
 help / color / mirror / code / Atom feed
From: Eric Cook <llua@gmx.com>
To: zsh-workers@zsh.org
Subject: [PATCH] Prevent wordsplitting in _mpc lsplaylists
Date: Fri, 13 Jan 2017 20:37:36 -0500	[thread overview]
Message-ID: <0cea6c6b-4a53-4423-858e-60eb724780b2@gmx.com> (raw)

A user on irc attempting to submit an patch from a gmail address kept getting
delivery failures. So i am submitting on his behalf.

---
mpc lsplaylists produces a newline separated list of values which can
contain meta-syntactic characters, spaces, and so on.  The current code
results in wordsplitting in the results if any of the playlists contain
spaces.

This patch attempts to fix this by splitting the results on newlines
instead.

Signed-off-by: Earnestly <zibeon@gmail.com>
---
 Completion/Unix/Command/_mpc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Completion/Unix/Command/_mpc b/Completion/Unix/Command/_mpc
index 11eab8463..e0c6888b0 100644
--- a/Completion/Unix/Command/_mpc
+++ b/Completion/Unix/Command/_mpc
@@ -131,7 +131,7 @@ _mpc_helper_songnumbers() {
 (( $+functions[_mpc_helper_playlists] )) ||
 _mpc_helper_playlists() {
   local list expl
-  list=($(mpc lsplaylists))
+  list=(${(f)"$(mpc lsplaylists)"})
   _wanted list expl playlist compadd -M $MPC_PLAYLIST_MATCHER $expl -a list
 }

--
2.11.0


                 reply	other threads:[~2017-01-14  1:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0cea6c6b-4a53-4423-858e-60eb724780b2@gmx.com \
    --to=llua@gmx.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).