mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
- Fix appending to c:\ or \ #2569.
This commit is contained in:
@@ -186,13 +186,11 @@ fn bool Path.equals(self, Path p2) @operator(==)
|
||||
fn Path? Path.append(self, Allocator allocator, String filename)
|
||||
{
|
||||
if (!self.path_string.len) return new(allocator, filename, self.env)!;
|
||||
assert(!is_separator(self.path_string[^1], self.env));
|
||||
|
||||
@pool()
|
||||
{
|
||||
DString dstr = dstring::temp_with_capacity(self.path_string.len + 1 + filename.len);
|
||||
dstr.append(self.path_string);
|
||||
dstr.append(PREFERRED_SEPARATOR);
|
||||
if (!is_separator(self.path_string[^1], self.env)) dstr.append(PREFERRED_SEPARATOR);
|
||||
dstr.append(filename);
|
||||
return new(allocator, dstr.str_view(), self.env);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user