Use shell-quote-wildcard-pattern on the switches string split by
split-string-and-unquote. This helps to quote such switches as
"--block-size='1" (bug#71935).
(cherry picked from commit
b249f022f1285aaf02705b6ac239d95e3b413c18)
"\\") ; Disregard Unix shell aliases!
insert-directory-program
" -d "
- (if (stringp switches)
- switches
- (mapconcat #'identity switches " "))
+ ;; Quote switches that require quoting
+ ;; such as "--block-size='1". But don't
+ ;; quote switches that use patterns
+ ;; such as "--ignore=PATTERN" (bug#71935).
+ (mapconcat #'shell-quote-wildcard-pattern
+ (if (stringp switches)
+ (split-string-and-unquote switches)
+ switches)
+ " ")
" -- "
;; Quote some characters that have
;; special meanings in shells; but