summaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-05-10 13:24:30 +0100
committerBram Moolenaar <Bram@vim.org>2022-05-10 13:24:30 +0100
commit0abc2871c105882ed1c1effb9a7757fad8a395bd (patch)
tree0377e3f47b0fda6713cc0e8b6426616457e07912 /src/alloc.c
parent57ff52677bf5ba1651281ffe40505df8feba4a36 (diff)
patch 8.2.4930: interpolated string expression requires escapingv8.2.4930
Problem: Interpolated string expression requires escaping. Solution: Do not require escaping in the expression.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 5218d00465..6d4db629e1 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -832,7 +832,7 @@ ga_add_string(garray_T *gap, char_u *p)
/*
* Concatenate a string to a growarray which contains bytes.
- * When "s" is NULL does not do anything.
+ * When "s" is NULL memory allocation fails does not do anything.
* Note: Does NOT copy the NUL at the end!
*/
void
@@ -869,14 +869,14 @@ ga_concat_len(garray_T *gap, char_u *s, size_t len)
/*
* Append one byte to a growarray which contains bytes.
*/
- void
+ int
ga_append(garray_T *gap, int c)
{
- if (ga_grow(gap, 1) == OK)
- {
- *((char *)gap->ga_data + gap->ga_len) = c;
- ++gap->ga_len;
- }
+ if (ga_grow(gap, 1) == FAIL)
+ return FAIL;
+ *((char *)gap->ga_data + gap->ga_len) = c;
+ ++gap->ga_len;
+ return OK;
}
#if (defined(UNIX) && !defined(USE_SYSTEM)) || defined(MSWIN) \