summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhengyi Fu <tsingyat@outlook.com>2023-03-31 23:50:22 (GMT)
committerZhengyi Fu <tsingyat@outlook.com>2023-03-31 23:57:46 (GMT)
commit915ef090c9c62d9e67652af3d75c46dd75abc5d0 (patch)
treef983547b8521fda2268781445cf7704fd90214fd
parent17b8d01e22c02afad1a38520499b76d09c599dc9 (diff)
downloadCMake-915ef090c9c62d9e67652af3d75c46dd75abc5d0.zip
CMake-915ef090c9c62d9e67652af3d75c46dd75abc5d0.tar.gz
CMake-915ef090c9c62d9e67652af3d75c46dd75abc5d0.tar.bz2
cmake-mode.el: escape shell arguments
Shell arguments containing "<" or ">" should be escaped. Otherwise, names such as CMAKE_<LANG>_FLAGS will be treated as IO redirection.
-rw-r--r--Auxiliary/cmake-mode.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/Auxiliary/cmake-mode.el b/Auxiliary/cmake-mode.el
index a11becb..7590ee3 100644
--- a/Auxiliary/cmake-mode.el
+++ b/Auxiliary/cmake-mode.el
@@ -372,7 +372,7 @@ optional argument topic will be appended to the argument list."
(interactive "s")
(let* ((bufname (if buffer buffer (concat "*CMake" type (if topic "-") topic "*")))
(buffer (if (get-buffer bufname) (get-buffer bufname) (generate-new-buffer bufname)))
- (command (concat cmake-mode-cmake-executable " " type " " topic))
+ (command (concat cmake-mode-cmake-executable " " type " " (shell-quote-argument topic)))
;; Turn of resizing of mini-windows for shell-command.
(resize-mini-windows nil)
)
@@ -391,7 +391,7 @@ optional argument topic will be appended to the argument list."
(interactive "s")
(let* ((bufname (if buffer buffer (concat "*CMake" type (if topic "-") topic "*")))
(buffer (if (get-buffer bufname) (get-buffer bufname) (generate-new-buffer bufname)))
- (command (concat cmake-mode-cmake-executable " " type " " topic))
+ (command (concat cmake-mode-cmake-executable " " type " " (shell-quote-argument topic)))
;; Turn of resizing of mini-windows for shell-command.
(resize-mini-windows nil)
)