Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] Prevent wordsplitting in _mpc lsplaylists



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@xxxxxxxxx>
---
 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



Messages sorted by: Reverse Date, Date, Thread, Author