summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ffi.c2
-rw-r--r--txr.18
2 files changed, 3 insertions, 7 deletions
diff --git a/ffi.c b/ffi.c
index 61551228..f8d7b566 100644
--- a/ffi.c
+++ b/ffi.c
@@ -2456,7 +2456,7 @@ static val ffi_varray_null_term_in(struct txr_ffi_type *tft, int copy, mem_t *sr
offs += elsize;
}
- return replace(vec_in, vec, zero, length_vec(vec));
+ return if3(vec_in, replace(vec_in, vec, zero, t), vec);
}
static val ffi_varray_null_term_get(struct txr_ffi_type *tft, mem_t *src,
diff --git a/txr.1 b/txr.1
index 07c07dec..ded3d636 100644
--- a/txr.1
+++ b/txr.1
@@ -61592,12 +61592,8 @@ The variable-length
.code zarray
also has a special in operation. Like the get operation, the in operation
extracts all elements until a terminating null, decoding them to a vector.
-Then, a range of the original vector object is replaced with the decoded vector.
-If the decoded vector is as long, or longer, than the original, all of the
-elements of the original are replaced and its length is extended as necessary
-to contain all of the new elements. If the decoded vector is shorter than the
-decoded one, then it replaces a range of the original one corresponding to
-its length.
+Then, the entire original vector is replaced with the new vector,
+even if the original vector is longer.
.coNP FFI type @ ptr
.synb