From a532d6533503e0481af8d4c6e1dee73be84c2fd1 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Sat, 7 Nov 2020 01:51:52 +0000 Subject: [PATCH] fixed a bug of not checking if the current script is null for @SCRIPTNAME in parse.c --- hawk/lib/parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hawk/lib/parse.c b/hawk/lib/parse.c index 07970b5b..e6bb4d99 100644 --- a/hawk/lib/parse.c +++ b/hawk/lib/parse.c @@ -6691,7 +6691,7 @@ retry: if (hawk_comp_oochars_bcstr(HAWK_OOECS_PTR(tok->name), HAWK_OOECS_LEN(tok->name), "@SCRIPTNAME") == 0) { /* special parser-level word @SCRIPTNAME. substitute an actual value for it */ - if (HAWK_UNLIKELY(hawk_ooecs_cpy(tok->name, tok->loc.file) == (hawk_oow_t)-1)) return -1; + if (HAWK_UNLIKELY(hawk_ooecs_cpy(tok->name, (tok->loc.file? tok->loc.file: HAWK_T(""))) == (hawk_oow_t)-1)) return -1; SET_TOKEN_TYPE (hawk, tok, TOK_STR); } else if (hawk_comp_oochars_bcstr(HAWK_OOECS_PTR(tok->name), HAWK_OOECS_LEN(tok->name), "@SCRIPTLINE") == 0)