mirror of
https://github.com/RubyMetric/chsrc
synced 2026-01-09 23:42:27 +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)
|
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;
|
||||||
|
|||||||
Reference in New Issue
Block a user