We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b849474 commit ff09316Copy full SHA for ff09316
1 file changed
langs/outlaw/string.c
@@ -0,0 +1,20 @@
1
+#include "values.h"
2
+
3
+int string_append(const val_str_t* s1, const val_str_t* s2, val_str_t* dest)
4
+{
5
+ if (!s1 && !s2) { return 0; }
6
+ int i1 = (s1 ? s1->len : 0);
7
+ int i2 = (s2 ? s2->len : 0);
8
+ int len = i1+i2;
9
+ dest->len = len;
10
+ int i;
11
+ if (s1) {
12
+ for (i = 0; i < s1->len; i++)
13
+ dest->codepoints[i] = s1->codepoints[i];
14
+ }
15
+ if (s2) {
16
+ for (i = 0; i < s2->len; i++)
17
+ dest->codepoints[i1 + i] = s2->codepoints[i];
18
19
+ return 2+len+((len % 2) == 0 ? 0 : 1);
20
+}
0 commit comments