Fix splitpath and wsplitpath for the file extension.

This commit is contained in:
Dave Belanger 2003-10-21 23:51:06 +00:00 committed by Alexandre Julliard
parent ad24c5599e
commit 2c39191ef1
2 changed files with 10 additions and 4 deletions

View File

@ -463,8 +463,11 @@ void _wsplitpath(const MSVCRT_wchar_t *inpath, MSVCRT_wchar_t *drv, MSVCRT_wchar
}
else if (dir) dir[0] = 0;
/* look for extension */
for (end = inpath; *end; end++) if (*end == '.') break;
/* look for extension: what's after the last dot */
end = NULL;
for (p = inpath; *p; p++) if (*p == '.') end = p;
if (!end) end = p; /* there's no extension */
if (fname)
{

View File

@ -376,8 +376,11 @@ void __cdecl _splitpath(const char* inpath, char * drv, char * dir,
}
else if (dir) dir[0] = 0;
/* look for extension */
for (end = inpath; *end; end++) if (*end == '.') break;
/* look for extension: what's after the last dot */
end = NULL;
for (p = inpath; *p; p++) if (*p == '.') end = p;
if (!end) end = p; /* there's no extension */
if (fname)
{