Merge pull request #1798 from Tetralux/filepath-patch

[path/filepath] Change join() to take a []string instead of varargs
This commit is contained in:
gingerBill
2022-05-21 08:50:27 +01:00
committed by GitHub
4 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -1276,7 +1276,7 @@ preprocess_internal :: proc(cpp: ^Preprocessor, tok: ^Token) -> ^Token {
if start.file != nil {
dir = filepath.dir(start.file.name)
}
path := filepath.join(dir, filename)
path := filepath.join({dir, filename})
if os.exists(path) {
tok = include_file(cpp, tok, path, start.next.next)
continue
+1 -1
View File
@@ -305,7 +305,7 @@ _glob :: proc(dir, pattern: string, matches: ^[dynamic]string, allocator := cont
n := fi.name
matched := match(pattern, n) or_return
if matched {
append(&m, join(dir, n))
append(&m, join({dir, n}))
}
}
return
+1 -1
View File
@@ -38,7 +38,7 @@ abs :: proc(path: string, allocator := context.allocator) -> (string, bool) {
return path_str, true
}
join :: proc(elems: ..string, allocator := context.allocator) -> string {
join :: proc(elems: []string, allocator := context.allocator) -> string {
for e, i in elems {
if e != "" {
p := strings.join(elems[i:], SEPARATOR_STRING, context.temp_allocator)
+1 -1
View File
@@ -88,7 +88,7 @@ abs :: proc(path: string, allocator := context.allocator) -> (string, bool) {
}
join :: proc(elems: ..string, allocator := context.allocator) -> string {
join :: proc(elems: []string, allocator := context.allocator) -> string {
for e, i in elems {
if e != "" {
return join_non_empty(elems[i:], allocator)