aboutsummaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-10-10 01:09:17 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-10-10 01:09:17 -0400
commit67702b2d77d8474c2a7fe7f1816f4eb9a0a98af1 (patch)
tree0294659e9ef662577c175af0c5989ab9a8f254c5 /compile.c
parenta2490f4a500fca4b84e5652d31fc621f9f20742b (diff)
Fix issue with non-ID chars in filenames
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/compile.c b/compile.c
index b4362dce..d8cbf8b4 100644
--- a/compile.c
+++ b/compile.c
@@ -1429,7 +1429,7 @@ CORD compile_statement(env_t *env, ast_t *ast)
case Use: {
auto use = Match(ast, Use);
if (use->what == USE_LOCAL) {
- CORD name = file_base_name(Match(ast, Use)->path);
+ CORD name = file_base_id(Match(ast, Use)->path);
env->code->variable_initializers = CORD_all(env->code->variable_initializers, "$", name, "$$initialize();\n");
} else if (use->what == USE_C_CODE) {
return CORD_all("#include \"", use->path, "\"\n");
@@ -1443,7 +1443,7 @@ CORD compile_statement(env_t *env, ast_t *ast)
for (size_t i = 0; i < tm_files.gl_pathc; i++) {
const char *filename = tm_files.gl_pathv[i];
env->code->variable_initializers = CORD_all(
- env->code->variable_initializers, "$", lib_id, "$", file_base_name(filename), "$$initialize();\n");
+ env->code->variable_initializers, "$", lib_id, "$", file_base_id(filename), "$$initialize();\n");
}
globfree(&tm_files);
}