Fix splitpath and wsplitpath for the file extension.
This commit is contained in:
parent
ad24c5599e
commit
2c39191ef1
|
@ -463,8 +463,11 @@ void _wsplitpath(const MSVCRT_wchar_t *inpath, MSVCRT_wchar_t *drv, MSVCRT_wchar
|
||||||
}
|
}
|
||||||
else if (dir) dir[0] = 0;
|
else if (dir) dir[0] = 0;
|
||||||
|
|
||||||
/* look for extension */
|
/* look for extension: what's after the last dot */
|
||||||
for (end = inpath; *end; end++) if (*end == '.') break;
|
end = NULL;
|
||||||
|
for (p = inpath; *p; p++) if (*p == '.') end = p;
|
||||||
|
|
||||||
|
if (!end) end = p; /* there's no extension */
|
||||||
|
|
||||||
if (fname)
|
if (fname)
|
||||||
{
|
{
|
||||||
|
|
|
@ -376,8 +376,11 @@ void __cdecl _splitpath(const char* inpath, char * drv, char * dir,
|
||||||
}
|
}
|
||||||
else if (dir) dir[0] = 0;
|
else if (dir) dir[0] = 0;
|
||||||
|
|
||||||
/* look for extension */
|
/* look for extension: what's after the last dot */
|
||||||
for (end = inpath; *end; end++) if (*end == '.') break;
|
end = NULL;
|
||||||
|
for (p = inpath; *p; p++) if (*p == '.') end = p;
|
||||||
|
|
||||||
|
if (!end) end = p; /* there's no extension */
|
||||||
|
|
||||||
if (fname)
|
if (fname)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue