mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 13:13:00 +00:00
[CMAKE]
- Sync with trunk r51050. svn path=/branches/cmake-bringup/; revision=51154
This commit is contained in:
commit
785bea480a
469 changed files with 16304 additions and 9647 deletions
|
@ -17,10 +17,13 @@ int _tchdir(const _TCHAR* _path)
|
|||
}
|
||||
|
||||
/* Update the drive-specific current directory variable */
|
||||
if (GetCurrentDirectoryW(MAX_PATH, newdir) && newdir[1] == L':')
|
||||
if (GetCurrentDirectoryW(MAX_PATH, newdir) >= 2)
|
||||
{
|
||||
WCHAR envvar[4] = { L'=', towupper(newdir[0]), L':', L'\0' };
|
||||
SetEnvironmentVariableW(envvar, newdir);
|
||||
if (newdir[1] == L':')
|
||||
{
|
||||
WCHAR envvar[4] = { L'=', towupper(newdir[0]), L':', L'\0' };
|
||||
SetEnvironmentVariableW(envvar, newdir);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -20,9 +20,12 @@
|
|||
int _getdrive(void)
|
||||
{
|
||||
WCHAR buffer[MAX_PATH];
|
||||
if (GetCurrentDirectoryW( MAX_PATH, buffer ) &&
|
||||
buffer[0] >= 'A' && buffer[0] <= 'z' && buffer[1] == ':')
|
||||
return towupper(buffer[0]) - 'A' + 1;
|
||||
if (GetCurrentDirectoryW( MAX_PATH, buffer )>=2)
|
||||
{
|
||||
buffer[0]=towupper(buffer[0]);
|
||||
if (buffer[0] >= L'A' && buffer[0] <= L'Z' && buffer[1] == L':')
|
||||
return buffer[0] - L'A' + 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue