aboutsummaryrefslogtreecommitdiff
path: root/stdlib/stdlib.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-03-15 14:22:11 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-03-15 14:22:11 -0400
commitf51acef40e8297d7bd41b774413aa8331ca946ed (patch)
tree56aa02541d60beb3ece496fed2c11afd3ae942f3 /stdlib/stdlib.c
parent7a2653501310825e02d99d51fb4b9f1aacc75214 (diff)
Overhaul of Path so it uses root and array of components instead of
stringly typed
Diffstat (limited to 'stdlib/stdlib.c')
-rw-r--r--stdlib/stdlib.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/stdlib/stdlib.c b/stdlib/stdlib.c
index 7d13fcbd..9b117a24 100644
--- a/stdlib/stdlib.c
+++ b/stdlib/stdlib.c
@@ -118,20 +118,7 @@ static bool parse_single_arg(const TypeInfo_t *info, char *arg, void *dest)
*(OptionalNum32_t*)dest = parsed;
return !isnan(parsed);
} else if (info == &Path$info) {
- Path_t path = Text$from_str(arg);
- if (Text$equal_values(path, Path("~"))) {
- path = Path("~/");
- } else if (Text$equal_values(path, Path("."))) {
- path = Path("./");
- } else if (Text$equal_values(path, Path(".."))) {
- path = Path("../");
- } else if (!Text$starts_with(path, Text("./"))
- && !Text$starts_with(path, Text("../"))
- && !Text$starts_with(path, Text("/"))
- && !Text$starts_with(path, Text("~/"))) {
- path = Text$concat(Text("./"), path);
- }
- *(OptionalText_t*)dest = path;
+ *(OptionalPath_t*)dest = Path$from_str(arg);
return true;
} else if (info->tag == TextInfo) {
*(OptionalText_t*)dest = Text$from_str(arg);