bugfix: "./" prefix was not working correctly
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Thu, 22 Jun 2023 14:17:08 +0000 (09:17 -0500)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Thu, 22 Jun 2023 14:17:08 +0000 (09:17 -0500)
compiler/src/onyx.c
shared/include/bh.h

index 635eb2142ba4749ada8fb9b819f4a54e1ea18659..36e0c58f15d3d7974e4b68597d29ca41a12b39e6 100644 (file)
@@ -511,6 +511,14 @@ static void context_init(CompileOptions* opts) {
         bh_arr_new(global_heap_allocator, context.doc_info->structures, 128);
         bh_arr_new(global_heap_allocator, context.doc_info->enumerations, 128);
     }
+
+    if (context.options->verbose_output > 0) {
+        bh_printf("File search path:\n");
+        bh_arr_each(const char *, p, context.options->included_folders) {
+            bh_printf("\t%s\n", *p);
+        }
+        bh_printf("\n");
+    }
 }
 
 static void context_free() {
index 1e0be390169da198e9fd6a7a43edd11430e09d28..d347344ad8d1f14f3f2a1e4c93e5f0ed1fc0e86a 100644 (file)
@@ -1988,7 +1988,7 @@ char* bh_lookup_file(char* filename, char* relative_to, char *suffix, b32 add_su
 
         if (bh_file_exists(path)) return bh_path_get_full_name(path, BH_INTERNAL_ALLOCATOR);
 
-        return fn;
+        return path;
     }
 
     if (search_included_folders) {