[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/slime 6ef28864d4 13/43: Handle null characters correctly i
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/slime 6ef28864d4 13/43: Handle null characters correctly in the Allegro backend. |
Date: |
Thu, 28 Dec 2023 22:00:29 -0500 (EST) |
branch: elpa/slime
commit 6ef28864d4a6b4d9390dbd0cac64f2a56582682d
Author: Robert Brown <robert.brown@gmail.com>
Commit: Luís Oliveira <luismbo@gmail.com>
Handle null characters correctly in the Allegro backend.
The Allegro function EXCL:OCTETS-TO-STRING, at least in Free Express Edition
10.1, stops processing octets when it encounters a null character, unless
the
target of octet conversion is an existing string. Work around the behavior
in UTF8-TO-STRING.
Modify test utf-8-source in slime-tests.el so that it includes a null
character.
---
slime-tests.el | 7 ++++---
swank/allegro.lisp | 9 +++++++--
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/slime-tests.el b/slime-tests.el
index b122119ee8..5a6c7767f3 100644
--- a/slime-tests.el
+++ b/slime-tests.el
@@ -735,9 +735,10 @@ Confirm that SUBFORM is correctly located."
(def-slime-test utf-8-source
(input output)
"Source code containing utf-8 should work"
- (list (let* ((bytes "\343\201\212\343\201\257\343\202\210\343\201\206")
- ;;(encode-coding-string (string #x304a #x306f #x3088 #x3046)
- ;; 'utf-8)
+ (list (let* ((bytes
"\000\343\201\212\343\201\257\343\202\210\343\201\206")
+ ;; (encode-coding-string
+ ;; (string #x0000 #x304a #x306f #x3088 #x3046)
+ ;; 'utf-8)
(string (decode-coding-string bytes 'utf-8-unix)))
(cl-assert (equal bytes (encode-coding-string string 'utf-8-unix)))
(list (concat "(defun cl-user::foo () \"" string "\")")
diff --git a/swank/allegro.lisp b/swank/allegro.lisp
index 9df6874afd..61ea12074b 100644
--- a/swank/allegro.lisp
+++ b/swank/allegro.lisp
@@ -41,8 +41,13 @@
(excl:string-to-octets s :external-format utf8-ef
:null-terminate nil))
-(defimplementation utf8-to-string (u)
- (excl:octets-to-string u :external-format utf8-ef))
+(defimplementation utf8-to-string (octets)
+ (let ((string (make-string (length octets))))
+ (multiple-value-bind (string chars-copied)
+ ;; Allegro 10.1 stops processing octets when it sees a zero,
+ ;; unless it is copying into an existing string.
+ (excl:octets-to-string octets :string string :external-format utf8-ef)
+ (subseq string 0 chars-copied))))
;;;; TCP Server
- [nongnu] elpa/slime a4f3471487 42/43: 2.2.8, (continued)
- [nongnu] elpa/slime a4f3471487 42/43: 2.2.8, ELPA Syncer, 2023/12/28
- [nongnu] elpa/slime 1ee576a53f 40/43: slime: slime-print-apropos use buttons for dispay, ELPA Syncer, 2023/12/28
- [nongnu] elpa/slime 3837255e0c 17/43: sbcl: Use file-write-date instead of debug-source-created, ELPA Syncer, 2023/12/28
- [nongnu] elpa/slime c5342a3086 14/43: Properly comment out multiline error messages during printout, ELPA Syncer, 2023/12/28
- [nongnu] elpa/slime 7e08d61fad 31/43: swank-asdf: Fix slime-load-system for systems with dots in the name, ELPA Syncer, 2023/12/28
- [nongnu] elpa/slime 4d540c8fc9 38/43: slime-cl-indent: fix lambda list indentation for single arg keywords, ELPA Syncer, 2023/12/28
- [nongnu] elpa/slime def8408e12 29/43: sexp-ref: accept dotted lists., ELPA Syncer, 2023/12/28
- [nongnu] elpa/slime 9d3d303333 24/43: clasp: Translate logical pathnames in source references, ELPA Syncer, 2023/12/28
- [nongnu] elpa/slime 485aa0ca17 16/43: extract-package, readtable-for-package: Use default readtable, ELPA Syncer, 2023/12/28
- [nongnu] elpa/slime 34b7e43530 09/43: abcl: implement inspection of locals in interpreted frames, ELPA Syncer, 2023/12/28
- [nongnu] elpa/slime 6ef28864d4 13/43: Handle null characters correctly in the Allegro backend.,
ELPA Syncer <=
- [nongnu] elpa/slime 649abf2c19 23/43: compute-enriched-decoded-arglist sb-assem:inst: catch NIL., ELPA Syncer, 2023/12/28
- [nongnu] elpa/slime 0a77a989fd 20/43: Fix extract-local-op-arglists for labels., ELPA Syncer, 2023/12/28
- [nongnu] elpa/slime 1f9a95f3a0 18/43: Revert "sbcl: Use file-write-date instead of debug-source-created", ELPA Syncer, 2023/12/28
- [nongnu] elpa/slime 32f5652d6a 15/43: sbcl: Improve inspection of functions and code components., ELPA Syncer, 2023/12/28
- [nongnu] elpa/slime 906900bf05 12/43: Fix #714, ELPA Syncer, 2023/12/28
- [nongnu] elpa/slime 4cc03df108 30/43: Make xref optional., ELPA Syncer, 2023/12/28