mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-11-22 22:02:23 -08:00
o_cloexec; preserve leading slashes in root-level paths
This commit is contained in:
1 parent
d4d2159389
commit
035e72306d
4 files changed
+327
-312
No files matched your search
@@ -1977,12 +1977,26 @@ rdim_bake_path_tree_insert(RDIM_Arena *arena, RDIM_BakePathTree *tree, RDIM_Stri
|
||||
RDI_U8 *opl = string.str + string.size;
|
||||
for(;ptr < opl;)
|
||||
{
|
||||
// rjf: skip past slashes
|
||||
for(;ptr < opl && (*ptr == '/' || *ptr == '\\'); ptr += 1);
|
||||
// rjf: skip past non-leading slashes
|
||||
RDI_U32 leading_slash = 0;
|
||||
if(ptr > string.str)
|
||||
{
|
||||
for(;ptr < opl && (*ptr == '/' || *ptr == '\\'); ptr += 1);
|
||||
}
|
||||
else if(ptr < opl)
|
||||
{
|
||||
leading_slash = (*ptr == '/');
|
||||
}
|
||||
|
||||
// rjf: save beginning of non-slash range
|
||||
// rjf: save beginning of path part
|
||||
RDI_U8 *range_first = ptr;
|
||||
|
||||
// rjf: advance past leading slash
|
||||
if(leading_slash)
|
||||
{
|
||||
ptr += 1;
|
||||
}
|
||||
|
||||
// rjf: skip past non-slashes
|
||||
for(;ptr < opl && !(*ptr == '/' || *ptr == '\\'); ptr += 1);
|
||||
|
||||
|
||||
Reference in new issue
Block a user