~mrms/filepathum

9b46036025302fe22be3d3fdb37db664a10697d8 — Marek Ma┼íkarinec 4 months ago 844e112
Fix another join bug
1 files changed, 2 insertions(+), 2 deletions(-)

M filepath.um
M filepath.um => filepath.um +2 -2
@@ 106,7 106,7 @@ fn join*(inp: ..str): str {

	o := ""
	for i,s in inp {
		o += s
		o += strings.trimprefix(s, str(fileseparator))
		if i < len(inp) - 1 && o[len(o) -1] != fileseparator {
			o += str(fileseparator)
		}


@@ 127,7 127,7 @@ fn split*(path: str): []str {
}

fn main() {
	path := join("home/", "user", "file.txt")
	path := join("home/", "/user", "file.txt")
	printf("path: %s\n", path)
	printf("dir: %s\n", dir(path))
	printf("file: %s\n", file(path))