Fixed automatic drive detection for the case that the root directory

is not already mapped.
This commit is contained in:
Michael Jung 2005-02-14 11:01:16 +00:00 committed by Alexandre Julliard
parent b33ef44105
commit 5e161ac72a
2 changed files with 7 additions and 4 deletions

View File

@ -151,9 +151,12 @@ static void ensure_root_is_mapped()
for (letter = 'Z'; letter >= 'A'; letter--)
{
if (drives[letter - 'A'].in_use) continue;
add_drive(letter, "/", "System", 0, DRIVE_FIXED);
WINE_TRACE("allocated drive %c as the root drive\n", letter);
if (!drives[letter - 'A'].in_use)
{
add_drive(letter, "/", "System", "0", DRIVE_FIXED);
WINE_TRACE("allocated drive %c as the root drive\n", letter);
break;
}
}
if (letter == ('A' - 1)) report_error(NO_ROOT);

View File

@ -108,7 +108,7 @@ void PRINTERROR(void); /* WINE_TRACE() the plaintext error message from GetLastE
/* returns a string in the win32 heap */
static inline char *strdupA(char *s)
{
char *r = HeapAlloc(GetProcessHeap(), 0, strlen(s));
char *r = HeapAlloc(GetProcessHeap(), 0, strlen(s)+1);
return strcpy(r, s);
}