aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanielGavin <danielgavin5@hotmail.com>2025-04-05 20:06:41 +0200
committerGitHub <noreply@github.com>2025-04-05 20:06:41 +0200
commit011b0bdec303783b6ce2a197957effef480ca50d (patch)
treeefb65ce331d7441260ee181127848ef36de4128f
parente8cf1cac42316248cf2fe8d7aea486cf8d5affed (diff)
parentdc72ed8137ece14ae9a1a9f274a5c53ddf8c7ca0 (diff)
Merge pull request #619 from Akselmo/fix-path
Check for path length
-rw-r--r--tools/odinfmt/main.odin5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/odinfmt/main.odin b/tools/odinfmt/main.odin
index a912001..a829be6 100644
--- a/tools/odinfmt/main.odin
+++ b/tools/odinfmt/main.odin
@@ -90,6 +90,9 @@ main :: proc() {
path := os.args[len(os.args) - 1]
if strings.has_prefix(os.args[len(os.args) - 1], "-") {
args_to_parse = os.args[1:]
+ }
+
+ if len(path) <= 1 {
path = "." // if no file was specified, use current directory as the starting path to look for `odinfmt.json`
}
@@ -186,4 +189,4 @@ main :: proc() {
}
os.exit(1 if write_failure else 0)
-}
+} \ No newline at end of file