mirror of
https://github.com/RubyMetric/chsrc
synced 2025-06-08 19:54:13 +08:00
Interpret home also on Linux
This commit is contained in:
parent
b7fbde047a
commit
f82bfe0cbb
10
include/xy.h
10
include/xy.h
@ -637,15 +637,13 @@ _xy_win_powershellv5_profile ()
|
|||||||
static bool
|
static bool
|
||||||
xy_file_exist (const char *path)
|
xy_file_exist (const char *path)
|
||||||
{
|
{
|
||||||
const char *newpath = path;
|
const char *new_path = path;
|
||||||
if (xy_on_windows)
|
|
||||||
{
|
|
||||||
if (xy_str_start_with (path, "~"))
|
if (xy_str_start_with (path, "~"))
|
||||||
{
|
{
|
||||||
newpath = xy_2strjoin (xy_os_home, path + 1);
|
new_path = xy_2strjoin (xy_os_home, path + 1);
|
||||||
}
|
}
|
||||||
}
|
// 0 即 F_OK
|
||||||
return access (newpath, 0) ? false : true;
|
return (0==access (new_path, 0)) ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user