Changeset 15398


Ignore:
Timestamp:
May 29, 2012, 7:01:58 PM (7 years ago)
Author:
gb
Message:

Sequences of one or more backslashes that precede a double-quote
character or whitespace need to be escaped (doubled).

Fixes ticket:858 in the trunk.

Changes made to the trunk are often incorporated in the next release.
We generally assume that people can call REBUILD-CCL for themselves
when there aren't any bootstrapping issues involved (and there aren't
here); we do often provide kernel binaries for Windows since (a) it
can be tricky to install the necessary toolchain and support and (b)
the available Windows toolchains are often broken.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-1/linux-files.lisp

    r15397 r15398  
    18181818           ((atom strings)     
    18191819            (if strings (write-string strings out)))
    1820         (let* ((string (car strings)))
    1821           (dotimes (i (length string))
     1820        (let* ((string (car strings))
     1821               (n (length string))
     1822               (quote-backslash 0)
     1823               (literal-backslash 0))
     1824          (declare (fixnum n quote-backslash literal-backslash))
     1825          (dotimes (i n)
    18221826            (let* ((c (schar string i)))
    18231827              (case c
     1828                (#\\
     1829                 (unless (or (> quote-backslash 0)
     1830                             (> literal-backslash 0))
     1831                   (do* ((j i (1+ j))
     1832                         (k 0))
     1833                        ((= j n) (setq literal-backslash k))
     1834                     (case (schar string j)
     1835                       (#\\ (incf k))
     1836                       ((#\space #\tab #\")
     1837                        (setq quote-backslash k)
     1838                        (return))
     1839                       (t (setq literal-backslash k)
     1840                          (return)))))
     1841                 (if (> quote-backslash 0)
     1842                   (progn
     1843                     (write-char #\\ out)
     1844                     (write-char #\\ out)
     1845                     (decf quote-backslash))
     1846                   (progn
     1847                     (write-char #\\ out)
     1848                     (decf literal-backslash))))
    18241849                ((#\space #\tab)
    18251850                 (write-char #\" out)
Note: See TracChangeset for help on using the changeset viewer.