1.0.33.2: Fix bug 489698 (reading #p"\\\\" on windows).
authorAlastair Bridgewater <lisphacker@users.sourceforge.net>
Sat, 28 Nov 2009 22:53:45 +0000 (22:53 +0000)
committerAlastair Bridgewater <lisphacker@users.sourceforge.net>
Sat, 28 Nov 2009 22:53:45 +0000 (22:53 +0000)
  * Actual bug was a missed range check prior to calling POSITION in
EXTRACT-DEVICE in src;code;win32-pathname.  Fixed.

  * Added test case.

NEWS
src/code/win32-pathname.lisp
tests/pathnames.impure.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index f2b2950..488934f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,8 @@
 changes relative to sbcl-1.0.33:
   * enhancement: SB-INTROSPECT:DEFTYPE-LAMBDA-LIST now also works on most
     builtin types.
+  * bug fix: #p"\\\\" can now be read without error on Win32 (reported by
+Willem Broekema; launchpad bug #489698).
 
 changes in sbcl-1.0.33 relative to sbcl-1.0.32:
   * new port: support added for x86-64 NetBSD.  (thanks to Aymeric Vincent)
index 8edaeda..a982f68 100644 (file)
@@ -20,7 +20,7 @@
         (cond ((and (eql c1 #\:) (alpha-char-p c0))
                ;; "X:" style, saved as X
                (values (string (char namestr start)) (+ start 2)))
-              ((and (member c0 '(#\/ #\\)) (eql c0 c1))
+              ((and (member c0 '(#\/ #\\)) (eql c0 c1) (>= end (+ start 3)))
                ;; "//UNC" style, saved as UNC
                ;; FIXME: at unparsing time we tell these apart by length,
                ;; which seems a bit lossy -- presumably one-letter UNC
index 5e9a8b8..7ed7250 100644 (file)
   (assert (eq :type-error-ok
               (handler-case (logical-pathname "SYS:%")
                 (type-error () :type-error-ok)))))
+
+;;; Reported by Willem Broekema: Reading #p"\\\\" caused an error due
+;;; to insufficient sanity in input testing in EXTRACT-DEVICE (in
+;;; src;code;win32-pathname).
+#+win32
+(with-test (:name :bug-489698)
+  (assert (equal (make-pathname :directory '(:absolute))
+                 (read-from-string "#p\"\\\\\\\\\""))))
+
 ;;;; success
index 3fc8d74..6d6c89b 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.33.1"
+"1.0.33.2"