Skip to content

Commit 15da301

Browse files
gh-166: Make REPLACE reject empty old.
1 parent 3b4f859 commit 15da301

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/builtins.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5691,7 +5691,7 @@ static Value builtin_replace(Interpreter* interp, Value* args, int argc, Expr**
56915691
size_t haystack_len = strlen(haystack);
56925692

56935693
if (needle_len == 0) {
5694-
return value_str(haystack);
5694+
RUNTIME_ERROR(interp, "REPLACE expects non-empty old substring", line, col);
56955695
}
56965696

56975697
// Count occurrences

0 commit comments

Comments
 (0)