mirror of
https://github.com/RubyMetric/chsrc
synced 2025-12-18 09:54:15 +08:00
Make windows recognize ~
This commit is contained in:
4
chsrc.h
4
chsrc.h
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user