mirror of
https://github.com/RubyMetric/chsrc
synced 2026-03-05 13:50:51 +08:00
修复 xy_normalize_path 内存泄露
This commit is contained in:
9
lib/xy.h
9
lib/xy.h
@@ -1249,13 +1249,14 @@ xy_normalize_path (const char *path)
|
|||||||
|
|
||||||
if (xy_str_start_with (new, "~"))
|
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)
|
if (xy.on_windows)
|
||||||
return xy_str_gsub (new, "/", "\\");
|
{
|
||||||
else
|
xy_str_swap (&new, xy_str_gsub (new, "/", "\\"));
|
||||||
return new;
|
}
|
||||||
|
return new;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user