From alemmens at common-lisp.net Mon Jun 20 17:22:10 2011 From: alemmens at common-lisp.net (CVS User alemmens) Date: Mon, 20 Jun 2011 10:22:10 -0700 Subject: [rucksack-cvs] CVS rucksack/doc Message-ID: Update of /project/rucksack/cvsroot/rucksack/doc In directory common-lisp.net:/tmp/cvs-serv17138/doc Modified Files: done.txt Log Message: Don't assume that non-simple strings always have fill-pointers when serializing. Thanks to pixel at kepibu.org. --- /project/rucksack/cvsroot/rucksack/doc/done.txt 2009/05/27 14:26:25 1.4 +++ /project/rucksack/cvsroot/rucksack/doc/done.txt 2011/06/20 17:22:08 1.5 @@ -1,3 +1,8 @@ +* 2011-06-20 - version 0.1.21 + +Fix a bug reported by pixel at kepibu.org: don't assume that non-simple +strings always have fill-pointers when serializing. + * 2009-05-27 - version 0.1.20 Fix a bug in the creation of transaction-ids (bug reported by Klaus From alemmens at common-lisp.net Mon Jun 20 17:22:18 2011 From: alemmens at common-lisp.net (CVS User alemmens) Date: Mon, 20 Jun 2011 10:22:18 -0700 Subject: [rucksack-cvs] CVS rucksack Message-ID: Update of /project/rucksack/cvsroot/rucksack In directory common-lisp.net:/tmp/cvs-serv17138 Modified Files: rucksack.asd serialize.lisp Log Message: Don't assume that non-simple strings always have fill-pointers when serializing. Thanks to pixel at kepibu.org. --- /project/rucksack/cvsroot/rucksack/rucksack.asd 2009/05/27 14:26:25 1.21 +++ /project/rucksack/cvsroot/rucksack/rucksack.asd 2011/06/20 17:22:14 1.22 @@ -1,9 +1,9 @@ -;;; $Id: rucksack.asd,v 1.21 2009/05/27 14:26:25 alemmens Exp $ +;;; $Id: rucksack.asd,v 1.22 2011/06/20 17:22:14 alemmens Exp $ (in-package :cl-user) (asdf:defsystem :rucksack - :version "0.1.20" + :version "0.1.21" :serial t :components ((:file "queue") (:file "package") --- /project/rucksack/cvsroot/rucksack/serialize.lisp 2007/01/22 10:23:14 1.10 +++ /project/rucksack/cvsroot/rucksack/serialize.lisp 2011/06/20 17:22:15 1.11 @@ -1,4 +1,4 @@ -;; $Id: serialize.lisp,v 1.10 2007/01/22 10:23:14 alemmens Exp $ +;; $Id: serialize.lisp,v 1.11 2011/06/20 17:22:15 alemmens Exp $ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Serialize @@ -905,7 +905,9 @@ type))))) (serialize-marker type-marker stream)) (unless simple-p - (serialize (fill-pointer string) stream) + (serialize (and (array-has-fill-pointer-p string) + (fill-pointer string)) + stream) (serialize (adjustable-array-p string) stream)) (serialize (length string) stream) (loop for char across string From alemmens at common-lisp.net Mon Jun 20 17:22:22 2011 From: alemmens at common-lisp.net (CVS User alemmens) Date: Mon, 20 Jun 2011 10:22:22 -0700 Subject: [rucksack-cvs] CVS rucksack/tests Message-ID: Update of /project/rucksack/cvsroot/rucksack/tests In directory common-lisp.net:/tmp/cvs-serv17138/tests Modified Files: test.lisp Log Message: Don't assume that non-simple strings always have fill-pointers when serializing. Thanks to pixel at kepibu.org. --- /project/rucksack/cvsroot/rucksack/tests/test.lisp 2008/02/11 12:47:53 1.2 +++ /project/rucksack/cvsroot/rucksack/tests/test.lisp 2011/06/20 17:22:22 1.3 @@ -1,4 +1,4 @@ -;; $Id: test.lisp,v 1.2 2008/02/11 12:47:53 alemmens Exp $ +;; $Id: test.lisp,v 1.3 2011/06/20 17:22:22 alemmens Exp $ (in-package :rucksack-test) @@ -42,6 +42,14 @@ (test (not (current-rucksack))) + ;; Non-simple strings without fill-pointers should be serialized without any problems. + (let ((str (make-array '(0) + :element-type 'character + :adjustable t + :fill-pointer nil))) + (p-test (p-list str) + (equal "" (p-car it)))) + ;; ;; P-CONS, P-CAR, P-CDR, P-LIST, P-MAKE-ARRAY, P-AREF ;; @@ -59,7 +67,6 @@ (equal '(a b) (list (p-aref it 0) (p-aref it 1)))) - ;; ;; Persistent-objects ;;