Make windows recognize ~

This commit is contained in:
Aoran Zeng 2023-09-27 15:54:23 +08:00
parent f65793c1db
commit 720f011c6e
2 changed files with 5 additions and 1 deletions

View File

@ -290,6 +290,10 @@ chsrc_check_file (const char* path)
{
char* cmd = NULL;
if(xy_on_windows) {
if (xy_str_start_with(path, "~/")){
path = xy_2strjoin("%USERPROFILE%\\", xy_str_delete_prefix(path, "~/"));
path = xy_str_gsub(path, "/", "\\");
}
cmd = xy_2strjoin ("type ", path);
} else {
cmd = xy_2strjoin ("cat ", path);