From 948d55185f7d6ce5aa654c2ad2a9d0d00cc19fd6 Mon Sep 17 00:00:00 2001 From: Mikachu2333 Date: Mon, 6 Oct 2025 03:01:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20xy=5Fnormalize=5Fpath=20?= =?UTF-8?q?=E5=86=85=E5=AD=98=E6=B3=84=E6=BC=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/xy.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/xy.h b/lib/xy.h index ff21a82..f7d1325 100644 --- a/lib/xy.h +++ b/lib/xy.h @@ -1250,7 +1250,10 @@ xy_normalize_path (const char *path) if (xy_str_start_with (new, "~")) { - xy_str_swap (&new, xy_2strcat (xy_os_home, xy_str_delete_prefix (new, "~"))); + char *tmp = xy_str_delete_prefix (new, "~"); + char *joined = xy_2strcat (xy_os_home, tmp); + free (tmp); + xy_str_swap (&new, joined); } if (xy.on_windows)