From 2304f4bf5f15652625609cd07d3f912f5d926a46 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Mon, 13 Apr 2020 18:48:27 +0200 Subject: [PATCH] :bug: Fix string compiling --- src/compile.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/compile.c b/src/compile.c index 5a76f67c..4d67706c 100644 --- a/src/compile.c +++ b/src/compile.c @@ -86,7 +86,7 @@ ANN static m_bool is_reg(const m_str path) { ANN static inline m_bool compiler_open(MemPool p, struct Compiler* c) { char name[strlen(c->name) + 1]; strcpy(name, c->name); - if(!is_reg(name)) { + if(c->type == COMPILE_FILE && !is_reg(name)) { gw_err(_("'%s': is a not a regular file\n"), name); return GW_ERROR; } @@ -110,7 +110,9 @@ ANN static inline m_bool _check(struct Gwion_* gwion, struct Compiler* c) { } ANN static m_uint _compile(struct Gwion_* gwion, struct Compiler* c) { - CHECK_BB(compiler_open(gwion->mp, c)) +// CHECK_BB(compiler_open(gwion->mp, c)) + if(compiler_open(gwion->mp, c) < 0) + return 0; if(_check(gwion, c) < 0) { gw_err(_("while compiling file '%s'\n"), c->base); return 0; -- 2.43.0