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