Skip to content

Commit

Permalink
Fixed a linux only reader bug where forward slashes in pageFilePath w…
Browse files Browse the repository at this point in the history
…ere being replaced with backslshes even on Linux
  • Loading branch information
amitaga committed Jan 22, 2016
1 parent 3e651e0 commit f79fe39
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Source/Readers/HTKMLFReader/HTKMLFReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,9 +466,10 @@ void HTKMLFReader<ElemType>::PrepareForTrainingOrTesting(const ConfigRecordType&
{
pageFilePath = (const wstring&) readerConfig(L"pageFilePath");

#ifdef _WIN32
// replace any '/' with '\' for compat with default path
std::replace(pageFilePath.begin(), pageFilePath.end(), '/', '\\');
#ifdef _WIN32

// verify path exists
DWORD attrib = GetFileAttributes(pageFilePath.c_str());
if (attrib == INVALID_FILE_ATTRIBUTES || !(attrib & FILE_ATTRIBUTE_DIRECTORY))
Expand Down

0 comments on commit f79fe39

Please sign in to comment.