From cda5280914a6bccec2b76d8d4341f4f4c5d62592 Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Wed, 6 Jul 2016 13:21:57 -0400 Subject: [PATCH] cmd/guru: fix quoting bug in Emacs binding combine-and-quote-strings is buggy. The value of this expression: (split-string-and-unquote (combine-and-quote-strings '("a" "" "b"))) is ("a" "b"). Consequently, if go-guru-scope is "", the following "-tags" flag is interpreted as the scope. Change-Id: I2955ffa2b95914e01d44b52690e810f816076d5c Reviewed-on: https://go-review.googlesource.com/24746 Reviewed-by: Dominik Honnef Reviewed-by: Alan Donovan --- cmd/guru/go-guru.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/guru/go-guru.el b/cmd/guru/go-guru.el index 88caf672..2f1a5b52 100644 --- a/cmd/guru/go-guru.el +++ b/cmd/guru/go-guru.el @@ -229,7 +229,7 @@ variant of `compilation-mode'." (or buffer-file-name (error "Cannot use guru on a buffer without a file name")) (let* ((filename (file-truename buffer-file-name)) - (cmd (combine-and-quote-strings (go-guru--command mode filename))) + (cmd (mapconcat #'shell-quote-argument (go-guru--command mode filename) " ")) (process-connection-type nil) ; use pipe (not pty) so EOF closes stdin (procbuf (compilation-start cmd 'go-guru-output-mode))) (with-current-buffer procbuf