mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-23 04:52:42 -08:00
prepare-args: coerce arguments for windows
This commit is contained in:
parent
f7e224b84e
commit
0144154b9d
1 changed files with 13 additions and 13 deletions
|
|
@ -47,9 +47,8 @@
|
|||
#+windows :escape-arguments nil))))
|
||||
|
||||
;;;
|
||||
;;; Wrapper around si_run_program call. Thanks to that C interface
|
||||
;;; isn't clobbered with lispisms. Ultimately we'd want to have as
|
||||
;;; little as possible in unixsys.d.
|
||||
;;; Almighty EXT:RUN-PROGRAM. Built on top of SI:SPAWN-SUBPROCESS. For
|
||||
;;; simpler alternative see SI:RUN-PROGRAM-INNER.
|
||||
;;;
|
||||
(defun run-program (command argv
|
||||
&key
|
||||
|
|
@ -79,16 +78,17 @@
|
|||
#-windows
|
||||
(mapcar #'si:copy-to-simple-base-string args)
|
||||
#+windows
|
||||
(with-output-to-string (str)
|
||||
(loop for (arg . rest) on args
|
||||
do (if (and escape-arguments
|
||||
(find-if (lambda (c)
|
||||
(find c '(#\Space #\Tab #\")))
|
||||
arg))
|
||||
(escape-arg arg str)
|
||||
(princ arg str))
|
||||
(when rest
|
||||
(write-char #\Space str))))))
|
||||
(si:copy-to-simple-base-string
|
||||
(with-output-to-string (str)
|
||||
(loop for (arg . rest) on args
|
||||
do (if (and escape-arguments
|
||||
(find-if (lambda (c)
|
||||
(find c '(#\Space #\Tab #\")))
|
||||
arg))
|
||||
(escape-arg arg str)
|
||||
(princ arg str))
|
||||
(when rest
|
||||
(write-char #\Space str)))))))
|
||||
|
||||
(setf input (process-stream input *standard-input*
|
||||
:direction :input
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue