mirror of
https://github.com/RubyMetric/chsrc.git
synced 2025-01-24 05:34:58 +08:00
Fix current dir case
This commit is contained in:
parent
3f8f8b0619
commit
ae72e78592
10
include/xy.h
10
include/xy.h
|
@ -780,11 +780,21 @@ xy_parent_dir (const char *path)
|
||||||
if (xy_on_windows)
|
if (xy_on_windows)
|
||||||
{
|
{
|
||||||
last = strrchr (dir, '\\');
|
last = strrchr (dir, '\\');
|
||||||
|
if (!last)
|
||||||
|
{
|
||||||
|
/* current dir */
|
||||||
|
return ".";
|
||||||
|
}
|
||||||
*last = '\0';
|
*last = '\0';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
last = strrchr (dir, '/');
|
last = strrchr (dir, '/');
|
||||||
|
if (!last)
|
||||||
|
{
|
||||||
|
/* current dir */
|
||||||
|
return ".";
|
||||||
|
}
|
||||||
*last = '\0';
|
*last = '\0';
|
||||||
}
|
}
|
||||||
return dir;
|
return dir;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user