summaryrefslogtreecommitdiff
path: root/src/c/urweb.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/c/urweb.c')
-rw-r--r--src/c/urweb.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/c/urweb.c b/src/c/urweb.c
index 10d474f4..f0e93e46 100644
--- a/src/c/urweb.c
+++ b/src/c/urweb.c
@@ -575,3 +575,17 @@ lw_Basis_string lw_Basis_strcat(lw_context ctx, lw_Basis_string s1, lw_Basis_str
return s;
}
+
+lw_Basis_string lw_Basis_strdup(lw_context ctx, lw_Basis_string s1) {
+ int len = strlen(s1) + 1;
+ char *s;
+
+ lw_check_heap(ctx, len);
+
+ s = ctx->heap_front;
+
+ strcpy(s, s1);
+ ctx->heap_front += len;
+
+ return s;
+}