From 7a440c828bf69ea61bd3c3019846b5b7b3e3e896 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Wed, 20 Aug 2025 12:30:15 +0200 Subject: [PATCH] Fixed endless loop on Windows searching the lib directory --- src/global/findLibrary.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/global/findLibrary.go b/src/global/findLibrary.go index dedcf01..af98065 100644 --- a/src/global/findLibrary.go +++ b/src/global/findLibrary.go @@ -1,6 +1,7 @@ package global import ( + "fmt" "os" "path/filepath" ) @@ -18,10 +19,13 @@ func findLibrary() { return } - if dir == "/" { - panic("standard library not found") + newDir := filepath.Dir(dir) + + if newDir == dir { + fmt.Fprintln(os.Stderr, "standard library not found") + os.Exit(1) } - dir = filepath.Dir(dir) + dir = newDir } } \ No newline at end of file -- 2.54.0