Fix current dir case

This commit is contained in:
Aoran Zeng 2024-12-14 19:51:21 +08:00
parent 3f8f8b0619
commit ae72e78592
No known key found for this signature in database
GPG Key ID: 8F8BA8488E10ED98

View File

@ -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;