diff options
Diffstat (limited to 'src/ilasm')
-rw-r--r-- | src/ilasm/grammar_after.cpp | 26 | ||||
-rw-r--r-- | src/ilasm/main.cpp | 10 |
2 files changed, 18 insertions, 18 deletions
diff --git a/src/ilasm/grammar_after.cpp b/src/ilasm/grammar_after.cpp index 61de517e0e..c8634801c7 100644 --- a/src/ilasm/grammar_after.cpp +++ b/src/ilasm/grammar_after.cpp @@ -858,23 +858,19 @@ Its_An_Id: if((parser->wzIncludePath != NULL) &&(wcschr(wzFile,'\\')==NULL)&&(wcschr(wzFile,':')==NULL)) { - WCHAR* wzFullName = new WCHAR[MAX_FILENAME_LENGTH+1]; - if(wzFullName != NULL) + PathString wzFullName; + + WCHAR* pwz; + DWORD dw = WszSearchPath(parser->wzIncludePath,wzFile,NULL, + TRUE, wzFullName,&pwz); + if(dw != 0) { - WCHAR* pwz; - DWORD dw = WszSearchPath(parser->wzIncludePath,wzFile,NULL, - MAX_FILENAME_LENGTH+1,wzFullName,&pwz); - if(dw != 0) - { - wzFullName[dw] = 0; - delete [] wzFile; - wzFile = wzFullName; - } - else - { - delete [] wzFullName; - } + wzFullName.CloseBuffer((COUNT_T)(dw)); + delete [] wzFile; + + wzFile = wzFullName.GetCopyOfUnicodeString(); } + } if(PASM->m_fReportProgress) parser->msg("\nIncluding '%S'\n",wzFile); diff --git a/src/ilasm/main.cpp b/src/ilasm/main.cpp index 50131b2b01..811c65640e 100644 --- a/src/ilasm/main.cpp +++ b/src/ilasm/main.cpp @@ -95,7 +95,7 @@ WCHAR *pwzDeltaFiles[1024]; char szInputFilename[MAX_FILENAME_LENGTH*3]; WCHAR wzInputFilename[MAX_FILENAME_LENGTH]; WCHAR wzOutputFilename[MAX_FILENAME_LENGTH]; -WCHAR wzIncludePathBuffer[MAX_FILENAME_LENGTH]; + #ifdef _PREFAST_ #pragma warning(push) @@ -628,8 +628,12 @@ extern "C" int _cdecl wmain(int argc, __in WCHAR **argv) } if(wzIncludePath == NULL) { - if(0!=WszGetEnvironmentVariable(W("ILASM_INCLUDE"),wzIncludePathBuffer,MAX_FILENAME_LENGTH)) - wzIncludePath = wzIncludePathBuffer; + PathString wzIncludePathBuffer; + if (0 != WszGetEnvironmentVariable(W("ILASM_INCLUDE"), wzIncludePathBuffer)) + { + wzIncludePath = wzIncludePathBuffer.GetCopyOfUnicodeString(); + + } } //------------ Assembler initialization done. Now, to business ----------------------- if((pParser = new AsmParse(NULL, pAsm))) |