From 5e161ac72a86209b71bfbcdea162a0c6a1292513 Mon Sep 17 00:00:00 2001 From: Michael Jung Date: Mon, 14 Feb 2005 11:01:16 +0000 Subject: [PATCH] Fixed automatic drive detection for the case that the root directory is not already mapped. --- programs/winecfg/drivedetect.c | 9 ++++++--- programs/winecfg/winecfg.h | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/programs/winecfg/drivedetect.c b/programs/winecfg/drivedetect.c index e24276c142f..4583e2f73c3 100644 --- a/programs/winecfg/drivedetect.c +++ b/programs/winecfg/drivedetect.c @@ -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); diff --git a/programs/winecfg/winecfg.h b/programs/winecfg/winecfg.h index f54f5439e4b..b2ba0a9109a 100644 --- a/programs/winecfg/winecfg.h +++ b/programs/winecfg/winecfg.h @@ -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); }