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 <dominik@honnef.co>
Reviewed-by: Alan Donovan <adonovan@google.com>
This commit is contained in:
Alan Donovan 2016-07-06 13:21:57 -04:00
parent 130914b004
commit cda5280914
1 changed files with 1 additions and 1 deletions

View File

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