Author: pschweitzer
Date: Sun Nov 25 19:45:02 2007
New Revision: 30742
URL:
http://svn.reactos.org/svn/reactos?rev=30742&view=rev
Log:
Improved check for log directory
Modified:
trunk/tools/RosBE/RosBE-Windows/Root/ChangeLog.txt
trunk/tools/RosBE/RosBE-Windows/Tools/config/options.c
Modified: trunk/tools/RosBE/RosBE-Windows/Root/ChangeLog.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Root/Cha…
==============================================================================
--- trunk/tools/RosBE/RosBE-Windows/Root/ChangeLog.txt (original)
+++ trunk/tools/RosBE/RosBE-Windows/Root/ChangeLog.txt Sun Nov 25 19:45:02 2007
@@ -5,6 +5,7 @@
- Updated RosBE Configuration Tool. (Pierre Schweitzer)
- Added help strings when mouse is over a control. (Pierre Schweitzer)
+ - Improved check for log directory (Pierre Schweitzer)
- Fix a bug in reladdr2line.cmd. (Peter Ward)
- Change the default ReactOS source directory from APPDATA\RosBE\Source to
PROFILE\reactos. (Peter Ward)
Modified: trunk/tools/RosBE/RosBE-Windows/Tools/config/options.c
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Tools/co…
==============================================================================
--- trunk/tools/RosBE/RosBE-Windows/Tools/config/options.c (original)
+++ trunk/tools/RosBE/RosBE-Windows/Tools/config/options.c Sun Nov 25 19:45:02 2007
@@ -17,7 +17,7 @@
{
INT foreground, background;
BOOL showtime, writelog, useccache, strip, objstate, outstate;
- WCHAR logdir[MAX_PATH], objdir[MAX_PATH], outdir[MAX_PATH], mingwpath[MAX_PATH],
checkmgw[MAX_PATH], checklog[MAX_PATH], optionsfile[MAX_PATH];
+ WCHAR logdir[MAX_PATH], objdir[MAX_PATH], outdir[MAX_PATH], mingwpath[MAX_PATH],
checkmgw[MAX_PATH], optionsfile[MAX_PATH];
WCHAR msgerror[256];
HANDLE hFile;
FILE *pFile;
@@ -37,18 +37,13 @@
if (writelog && (logdir[0] != 0))
{
- DWORD ret = GetCurrentDirectoryW(MAX_PATH, checklog);
- if (ret != 0 && ret < MAX_PATH)
- {
- if (!SetCurrentDirectoryW(logdir))
- {
- SetCurrentDirectoryW(checklog);
- if (CreateDirectoryW(logdir, NULL) == 0)
- {
- if (LoadStringW(hInstance, MSG_DIREFAILED, msgerror, 256))
- MessageBoxW(NULL, msgerror, NULL, MB_ICONERROR);
- return FALSE;
- }
+ if (GetFileAttributes(logdir) == 0xFFFFFFFF)
+ {
+ if (CreateDirectoryW(logdir, NULL) == 0)
+ {
+ LoadStringW(hInstance, MSG_DIREFAILED, msgerror, 256);
+ MessageBoxW(NULL, msgerror, NULL, MB_ICONERROR);
+ return FALSE;
}
}
}