mirror of
https://gitee.com/RubyMetric/chsrc.git
synced 2025-12-25 20:52:49 +00:00
修复 xy_normalize_path 内存泄露
This commit is contained in:
parent
a3600bf05f
commit
2a9d13bfc8
9
lib/xy.h
9
lib/xy.h
|
|
@ -1249,13 +1249,14 @@ xy_normalize_path (const char *path)
|
|||
|
||||
if (xy_str_start_with (new, "~"))
|
||||
{
|
||||
new = xy_2strcat (xy_os_home, xy_str_delete_prefix (new, "~"));
|
||||
xy_str_swap (&new, xy_2strcat (xy_os_home, xy_str_delete_prefix (new, "~")));
|
||||
}
|
||||
|
||||
if (xy.on_windows)
|
||||
return xy_str_gsub (new, "/", "\\");
|
||||
else
|
||||
return new;
|
||||
{
|
||||
xy_str_swap (&new, xy_str_gsub (new, "/", "\\"));
|
||||
}
|
||||
return new;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue