Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/ilasm/asmman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -965,8 +965,10 @@ HRESULT AsmMan::EmitManifest()
for(j=0; (hFile == INVALID_HANDLE_VALUE)&&(pwzInputFiles[j] != NULL); j++)
{
wcscpy_s(wzFileName,2048,pwzInputFiles[j]);
pwz = wcsrchr(wzFileName,'\\');
pwz = wcsrchr(wzFileName,DIRECTORY_SEPARATOR_CHAR_A);
#ifndef FEATURE_PAL
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#ifdef TARGET_UNIX is a preferred way now, can you please change it here and at the two other places?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Jan, it looks like the TARGET_UNIX macro doesn't exist on the 3.1 branch, only on the mainline. FEATURE_PAL seemed to be the equivalent test on the older 3.1 codebase.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I am sorry, I have not noticed this is the 3.1 port and not the original 5.0 change.

if(pwz == NULL) pwz = wcsrchr(wzFileName,':');
#endif
if(pwz == NULL) pwz = &wzFileName[0];
else pwz++;
wcscpy_s(pwz,2048-(pwz-wzFileName),wzUniBuf);
Expand Down
6 changes: 5 additions & 1 deletion src/ilasm/grammar_after.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,11 @@ int yylex()
if(wzFile != NULL)
{
if((parser->wzIncludePath != NULL)
&&(wcschr(wzFile,'\\')==NULL)&&(wcschr(wzFile,':')==NULL))
&&(wcschr(wzFile,DIRECTORY_SEPARATOR_CHAR_A)==NULL)
#ifndef FEATURE_PAL
&&(wcschr(wzFile,':')==NULL)
#endif
)
{
PathString wzFullName;

Expand Down
2 changes: 1 addition & 1 deletion src/ilasm/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void MakeProperSourceFileName(__in __nullterminated WCHAR* wzOrigName,
{
j--;
if(wzProperName[j] == '.') break;
if((wzProperName[j] == '\\')||(j == 0))
if((wzProperName[j] == DIRECTORY_SEPARATOR_CHAR_A)||(j == 0))
{
wcscat_s(wzProperName,MAX_FILENAME_LENGTH,W(".il"));
break;
Expand Down
8 changes: 6 additions & 2 deletions src/ilasm/writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,10 @@ HRESULT Assembler::CreateExportDirectory()
char* szOutputFileName = new char[Ldllname];
memset(szOutputFileName,0,wcslen(m_wzOutputFileName)*3+3);
WszWideCharToMultiByte(CP_ACP,0,m_wzOutputFileName,-1,szOutputFileName,Ldllname,NULL,NULL);
pszDllName = strrchr(szOutputFileName,'\\');
pszDllName = strrchr(szOutputFileName,DIRECTORY_SEPARATOR_CHAR_A);
#ifndef FEATURE_PAL
if(pszDllName == NULL) pszDllName = strrchr(szOutputFileName,':');
#endif
if(pszDllName == NULL) pszDllName = szOutputFileName;
Ldllname = (unsigned)strlen(pszDllName)+1;

Expand Down Expand Up @@ -1100,8 +1102,10 @@ HRESULT Assembler::CreatePEFile(__in __nullterminated WCHAR *pwzOutputFilename)
else
{
WCHAR* pwc;
if ((pwc = wcsrchr(m_wzOutputFileName, '\\')) != NULL) pwc++;
if ((pwc = wcsrchr(m_wzOutputFileName, DIRECTORY_SEPARATOR_CHAR_A)) != NULL) pwc++;
#ifndef FEATURE_PAL
else if ((pwc = wcsrchr(m_wzOutputFileName, ':')) != NULL) pwc++;
#endif
else pwc = m_wzOutputFileName;

wcsncpy_s(wzScopeName, MAX_SCOPE_LENGTH, pwc, _TRUNCATE);
Expand Down