Changeset 11813


Ignore:
Timestamp:
05/02/09 19:36:44 (14 years ago)
Author:
ehuelsmann
Message:

Fix building in a path with spaces.

Found by: Mark Tarver
Fixes: https://sourceforge.net/tracker/?func=detail&atid=475785&aid=2784411&group_id=55057

Location:
trunk/abcl
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/build-abcl.lisp

    r11687 r11813  
    1414(in-package #:build-abcl)
    1515
     16(defun comp (string char)
     17  "Chops off the character at the end of `string' if it matches char"
     18  (let ((len (length string)))
     19    (if (eql char (char string (1- len)))
     20        (subseq string 0 (1- len))
     21        string)))
     22
    1623(defun safe-namestring (pathname)
    17   (let ((string (namestring pathname)))
     24  (let* ((string (namestring pathname))
     25         (len (length string)))
    1826    (when (position #\space string)
    19       (setf string (concatenate 'string "\"" string "\"")))
     27      (setf string (concatenate 'string "\""
     28                                (comp string #\\)
     29                                "\"")))
    2030    string))
    2131
     
    310320                                    (princ *java-compiler-command-line-prefix* s)
    311321                                    (princ " -d " s)
    312                                     (princ *build-root* s)
     322                                    (princ (safe-namestring *build-root*) s)
    313323                                    (princ #\Space s)
    314324                                    (dolist (source-file source-files)
    315325                                      (princ
    316                                        (if (equal (pathname-directory source-file) dir)
    317                                            (file-namestring source-file)
    318                                            (namestring source-file))
     326                                       (safe-namestring
     327                                        (if (equal (pathname-directory source-file) dir)
     328                                            (file-namestring source-file)
     329                                            (namestring source-file)))
    319330                                       s)
    320331                                      (princ #\space s))))
     
    324335                  (ensure-directories-exist *build-root*)
    325336                  (dolist (source-file source-files t)
    326                     (unless (java-compile-file source-file)
     337                    (unless (java-compile-file (safe-namestring source-file))
    327338                      (format t "Build failed.~%")
    328339                      (return nil)))))))))
  • trunk/abcl/src/org/armedbear/lisp/Site.java

    r11676 r11813  
    3636import java.io.File;
    3737import java.net.URL;
     38import java.net.URLDecoder;
    3839
    3940public final class Site extends Lisp
     
    4849            if (protocol != null && protocol.equals("file")) {
    4950                String path = url.getPath();
     51                try {
     52                    path = URLDecoder.decode(path, "UTF-8");
     53                }
     54                catch (java.io.UnsupportedEncodingException uee) {
     55                    // can't happen: Java implementations are required to
     56                    // support UTF-8
     57                }
    5058                int index = path.lastIndexOf('/');
    5159                if (index >= 0) {
Note: See TracChangeset for help on using the changeset viewer.