Comment 9 for bug 791800

Revision history for this message
Stas Boukarev (stassats) wrote :

It works on windows, except for the test, here's a working version:
(with-test (:name (:run-program :set-directory))
  (let* ((directory #-win32 "/"
                    #+win32 "c:\\")
         (out (sb-ext:process-output
               (sb-ext:run-program #-win32 "/bin/sh"
                                   #-win32 '("-c" "pwd")
                                   #+win32 "cmd.exe"
                                   #+win32 '("/c" "cd")
                                   :output :stream
                                   :directory directory
                                   :search t))))
    (assert
     (equal directory
            (string-right-trim '(#\Return) (read-line out))))))

Another correction would be removing spaces in
+ /* Change working directory if supplied. */
+ if ( pwd ) {
+ if ( chdir ( pwd ) < 0) {
+ goto error_exit;
+ }
+ }
+
so that it reads (pwd) and so on.

With these changes, I will commit it after the freeze.