diff --git a/paint/sources/ui/tab_console.c b/paint/sources/ui/tab_console.c index fc73cae5..4fcf8597 100644 --- a/paint/sources/ui/tab_console.c +++ b/paint/sources/ui/tab_console.c @@ -17,8 +17,9 @@ void tab_console_draw_export_on_file_picked(char *path) { void tab_console_run_done(char *s) { console_log(tr("Script updated.")); - if (starts_with(s, "```c")) { - s = substring(s, 5, string_length(s) - 4); + i32 i = string_index_of(s, "```c"); + if (i >= 0) { + s = substring(s, i + 5, string_length(s) - 4); } tab_scripts_get();