From 1707a3daa97de2ab9ceea5d8e277e2a070cfa71a Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Wed, 10 Aug 2011 17:14:51 -0700 Subject: [PATCH] C-peek-cstringp! now returns () at NULL on end of a strvec. --- src/microcode/pruxffi.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/microcode/pruxffi.c b/src/microcode/pruxffi.c index 26fc706f2..805d6eb40 100644 --- a/src/microcode/pruxffi.c +++ b/src/microcode/pruxffi.c @@ -185,9 +185,16 @@ DEFINE_PRIMITIVE ("C-PEEK-CSTRINGP!", Prim_peek_cstringp_bang, 2, 2, 0) PRIMITIVE_HEADER (2); { char ** ptr = (ALIEN_ADDRESS_LOC (char *)); - SCM string = char_pointer_to_string (*ptr); - set_alien_address ((ARG_REF (1)), (ptr + 1)); /* No more aborts! */ - PRIMITIVE_RETURN (string); + if (*ptr == NULL) + { + PRIMITIVE_RETURN (SHARP_F); + } + else + { + SCM string = char_pointer_to_string (*ptr); + set_alien_address ((ARG_REF (1)), (ptr + 1)); /* No more aborts! */ + PRIMITIVE_RETURN (string); + } } } -- 2.25.1