Commit 87c07e5d authored by Raymond Toy's avatar Raymond Toy
Browse files

Make sure spawn is called with a string

The previous commit worked for search lists, but the program could be
a string.  Take care to convert pathnames to strings so that spawn is
always called with a string.
parent b8841170
Loading
Loading
Loading
Loading
+15 −5
Original line number Diff line number Diff line
@@ -522,8 +522,18 @@
  ;; Make sure all the args are okay.
  (unless (every #'simple-string-p args)
    (error (intl:gettext "All args to program must be simple strings -- ~S.") args))

  ;; Make sure program is a string that we can use with spawn.
  (setf program
	(if (pathnamep program)
	    (lisp::with-pathname (p program)
	      (or (unix::unix-namestring p)
		  (namestring p)))
	    (namestring program)))
  (check-type program string)

  ;; Prepend the program to the argument list.
  (push (namestring program) args)
  (push program args)
  ;; Clear random specials used by GET-DESCRIPTOR-FOR to communicate cleanup
  ;; info.  Also, establish proc at this level so we can return it.
  (let (*close-on-error* *close-in-parent* *handlers-installed* proc)
@@ -567,7 +577,7 @@
					env))
			(let ((child-pid
				(without-gcing
				(spawn (unix::unix-namestring program)
				    (spawn program
					   argv envp pty-name
					   stdin stdout stderr))))
			  (when (< child-pid 0)