aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--main.odin9
-rw-r--r--time.odin3
3 files changed, 14 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..ec1b0d7
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+*.ics
+statics_data
+*.exe
+*.pdb \ No newline at end of file
diff --git a/main.odin b/main.odin
index d6a952c..9327e69 100644
--- a/main.odin
+++ b/main.odin
@@ -336,7 +336,7 @@ load_aliases :: proc() -> bool {
fmt.eprintln("ERROR: Failed to load data from %s: %s", info.fullpath, err)
} else {
found_alias = true
- aliases[info.name] = string(file_data)
+ aliases[strings.clone(info.name, context.allocator)] = string(file_data)
}
}
@@ -359,7 +359,12 @@ get_from_alias :: proc(alias : string) -> string {
url, ok := aliases[alias]
if !ok {
- fmt.eprintfln("ERROR: Could not find alias: %s", alias)
+ fmt.eprintfln("ERROR: Could not find alias '%s' among:", alias)
+ i:=0
+ for key, value in aliases {
+ fmt.eprintfln(" %d: %s -> %s...", i, key, value[:min(len(value), 64)])
+ i+=1
+ }
return ""
}
diff --git a/time.odin b/time.odin
index 2535dff..4c04ad5 100644
--- a/time.odin
+++ b/time.odin
@@ -478,6 +478,9 @@ importICS :: proc(path: string, verbose: bool = false) -> ([dynamic]Timeblock, b
}
line_nr += 1
}
+
+ slice.sort_by(output[:], lessTimeblock)
+
return output, true
}