mirror of
https://github.com/RubyMetric/chsrc.git
synced 2025-02-02 06:46:22 +08:00
Make windows recognize ~
This commit is contained in:
parent
f65793c1db
commit
720f011c6e
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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user