diff --git a/main/gbx/gbx_project.c b/main/gbx/gbx_project.c index 6b31c2eb5..400a9d62a 100644 --- a/main/gbx/gbx_project.c +++ b/main/gbx/gbx_project.c @@ -344,9 +344,11 @@ void PROJECT_init(const char *file) if (EXEC_arch) { - path = FILE_get_dir(file); - - FILE_chdir(path); + if (FILE_is_absolute(file)) + { + path = FILE_get_dir(file); + FILE_chdir(path); + } path = FILE_getcwd(NULL); if (path == NULL) diff --git a/main/gbx/gbx_subr_file.c b/main/gbx/gbx_subr_file.c index 178ca8e71..7b7ca3885 100755 --- a/main/gbx/gbx_subr_file.c +++ b/main/gbx/gbx_subr_file.c @@ -117,6 +117,8 @@ static STREAM *get_default(intptr_t val) ({ \ STREAM *stream; \ \ + VARIANT_undo(_value); \ + \ if ((_can_default) && TYPE_is_integer((_value)->type) && (_value)->_integer.value >= 0 && (_value)->_integer.value <= 2) \ stream = get_default((intptr_t)(_value)->_integer.value); \ else \