zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] Prevent wordsplitting in _mpc lsplaylists
@ 2017-01-14  1:37 Eric Cook
  0 siblings, 0 replies; only message in thread
From: Eric Cook @ 2017-01-14  1:37 UTC (permalink / raw)
  To: zsh-workers

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-01-14  1:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-14  1:37 [PATCH] Prevent wordsplitting in _mpc lsplaylists Eric Cook

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).