[ros-diffs] [weiden] 27599: Fix checking the file's existence

weiden at svn.reactos.org weiden at svn.reactos.org
Wed Jul 11 21:43:57 CEST 2007


Author: weiden
Date: Wed Jul 11 23:43:57 2007
New Revision: 27599

URL: http://svn.reactos.org/svn/reactos?rev=27599&view=rev
Log:
Fix checking the file's existence

Modified:
    trunk/reactos/dll/win32/syssetup/install.c

Modified: trunk/reactos/dll/win32/syssetup/install.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/install.c?rev=27599&r1=27598&r2=27599&view=diff
==============================================================================
--- trunk/reactos/dll/win32/syssetup/install.c (original)
+++ trunk/reactos/dll/win32/syssetup/install.c Wed Jul 11 23:43:57 2007
@@ -146,30 +146,24 @@
     TCHAR title[256];
     TCHAR name[256];
     LPTSTR p = path;
-    TCHAR szSystemPath[MAX_PATH];
-    TCHAR szProgramPath[MAX_PATH];
     TCHAR szWorkingDir[MAX_PATH];
     LPTSTR lpWorkingDir = NULL;
     LPTSTR lpFilePart;
     DWORD dwLen;
 
-    if (bCheckExistence)
-    {
-        if (!GetSystemDirectory(szSystemPath, sizeof(szSystemPath)/sizeof(szSystemPath[0])))
-            return FALSE;
-        _tcscpy(szProgramPath, szSystemPath);
-        _tcscat(szProgramPath, _T("\\"));
-        if ((_taccess(_tcscat(szProgramPath, command), 0 )) == -1)
-            /* Expected error, don't return FALSE */
-            return TRUE;
-    }
-
     if (ExpandEnvironmentStrings(command,
                                  path,
                                  sizeof(path) / sizeof(path[0])) == 0)
     {
         _tcscpy(path,
                 command);
+    }
+
+    if (bCheckExistence)
+    {
+        if ((_taccess(path, 0 )) == -1)
+            /* Expected error, don't return FALSE */
+            return TRUE;
     }
 
     dwLen = GetFullPathName(path,




More information about the Ros-diffs mailing list