Skip to content
Merged
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
8 changes: 2 additions & 6 deletions src/coreclr/pal/src/file/file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,6 @@ CorUnix::InternalCanonicalizeRealPath(LPCSTR lpUnixPath, PathCharString& lpBuffe
}
else
{
#if defined(HOST_AMD64)
bool fSetFilename = true;
// Since realpath implementation cannot handle inexistent filenames,
// check if we are going to truncate the "/" corresponding to the
Expand All @@ -358,8 +357,9 @@ CorUnix::InternalCanonicalizeRealPath(LPCSTR lpUnixPath, PathCharString& lpBuffe
fSetFilename = false;
}
else
#endif // defined(HOST_AMD64)
{
*pchSeparator = '\0';
}

if (!RealPathHelper(lpExistingPath, lpBuffer))
{
Expand All @@ -368,16 +368,12 @@ CorUnix::InternalCanonicalizeRealPath(LPCSTR lpUnixPath, PathCharString& lpBuffe
goto LExit;
}

#if defined(HOST_AMD64)
if (fSetFilename == true)
#endif // defined(HOST_AMD64)
lpFilename = pchSeparator + 1;
}

#if defined(HOST_AMD64)
if (lpFilename == NULL)
goto LExit;
#endif // HOST_AMD64

if (!lpBuffer.Append("/",1) || !lpBuffer.Append(lpFilename, strlen(lpFilename)))
{
Expand Down
Loading