fix leak in •file.List
This commit is contained in:
parent
4af4b45ab7
commit
23fc280383
@ -60,7 +60,7 @@ I8Arr* file_bytes(B path) { // consumes
|
|||||||
B file_chars(B path) { // consumes
|
B file_chars(B path) { // consumes
|
||||||
return fromUTF8a(file_bytes(path));
|
return fromUTF8a(file_bytes(path));
|
||||||
}
|
}
|
||||||
B file_lines(B path) { // consumes
|
B file_lines(B path) { // consumes; TODO rewrite this, it's horrible
|
||||||
I8Arr* tf = file_bytes(path);
|
I8Arr* tf = file_bytes(path);
|
||||||
usz ia = tf->ia; u8* p = (u8*)tf->a;
|
usz ia = tf->ia; u8* p = (u8*)tf->a;
|
||||||
usz lineCount = 0;
|
usz lineCount = 0;
|
||||||
@ -202,6 +202,7 @@ B file_list(B path) {
|
|||||||
char* name = c->d_name;
|
char* name = c->d_name;
|
||||||
if (name[0]=='.'? !(name[1]==0 || (name[1]=='.'&&name[2]==0)) : true) res = vec_add(res, m_str8l(name));
|
if (name[0]=='.'? !(name[1]==0 || (name[1]=='.'&&name[2]==0)) : true) res = vec_add(res, m_str8l(name));
|
||||||
}
|
}
|
||||||
|
closedir(d);
|
||||||
dec(path);
|
dec(path);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user