Skip to content

Commit

Permalink
Common/FileSystem: Fix misspelling of 'separator'
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelforney authored and stenzek committed Dec 25, 2020
1 parent d0398c8 commit 7a40a84
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
10 changes: 5 additions & 5 deletions src/common/file_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void CanonicalizePath(char* Destination, u32 cbDestination, const char* Path, bo

// fix ospath
if (OSPath && (currentCh == '\\' || currentCh == '/'))
currentCh = FS_OSPATH_SEPERATOR_CHARACTER;
currentCh = FS_OSPATH_SEPARATOR_CHARACTER;

// copy character
if (destinationLength < cbDestination)
Expand Down Expand Up @@ -547,7 +547,7 @@ void BuildOSPath(char* Destination, u32 cbDestination, const char* Path)
for (i = 0; i < pathLength; i++)
{
if (Destination[i] == '/')
Destination[i] = FS_OSPATH_SEPERATOR_CHARACTER;
Destination[i] = FS_OSPATH_SEPARATOR_CHARACTER;
}
}
else
Expand All @@ -556,7 +556,7 @@ void BuildOSPath(char* Destination, u32 cbDestination, const char* Path)
pathLength = std::max(pathLength, cbDestination - 1);
for (i = 0; i < pathLength; i++)
{
Destination[i] = (Path[i] == '/') ? FS_OSPATH_SEPERATOR_CHARACTER : Path[i];
Destination[i] = (Path[i] == '/') ? FS_OSPATH_SEPARATOR_CHARACTER : Path[i];
}

Destination[pathLength] = '\0';
Expand All @@ -576,7 +576,7 @@ void BuildOSPath(String& Destination, const char* Path)
for (i = 0; i < pathLength; i++)
{
if (Destination[i] == '/')
Destination[i] = FS_OSPATH_SEPERATOR_CHARACTER;
Destination[i] = FS_OSPATH_SEPARATOR_CHARACTER;
}
}
else
Expand All @@ -586,7 +586,7 @@ void BuildOSPath(String& Destination, const char* Path)
Destination.Resize(pathLength);
for (i = 0; i < pathLength; i++)
{
Destination[i] = (Path[i] == '/') ? FS_OSPATH_SEPERATOR_CHARACTER : Path[i];
Destination[i] = (Path[i] == '/') ? FS_OSPATH_SEPARATOR_CHARACTER : Path[i];
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/common/file_system.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
class ByteStream;

#ifdef WIN32
#define FS_OSPATH_SEPERATOR_CHARACTER '\\'
#define FS_OSPATH_SEPARATOR_CHARACTER '\\'
#define FS_OSPATH_SEPARATOR_STR "\\"
#else
#define FS_OSPATH_SEPERATOR_CHARACTER '/'
#define FS_OSPATH_SEPARATOR_CHARACTER '/'
#define FS_OSPATH_SEPARATOR_STR "/"
#endif

Expand Down
4 changes: 2 additions & 2 deletions src/duckstation-qt/qthostinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -767,15 +767,15 @@ void QtHostInterface::saveInputProfile(const QString& profile_name)
QString QtHostInterface::getUserDirectoryRelativePath(const QString& arg) const
{
QString result = QString::fromStdString(m_user_directory);
result += FS_OSPATH_SEPERATOR_CHARACTER;
result += FS_OSPATH_SEPARATOR_CHARACTER;
result += arg;
return result;
}

QString QtHostInterface::getProgramDirectoryRelativePath(const QString& arg) const
{
QString result = QString::fromStdString(m_program_directory);
result += FS_OSPATH_SEPERATOR_CHARACTER;
result += FS_OSPATH_SEPARATOR_CHARACTER;
result += arg;
return result;
}
Expand Down
4 changes: 2 additions & 2 deletions src/frontend-common/game_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1157,9 +1157,9 @@ std::string GameList::GetCoverImagePathForEntry(const GameListEntry* entry) cons
{
cover_path.Clear();
cover_path.AppendString(g_host_interface->GetUserDirectory().c_str());
cover_path.AppendCharacter(FS_OSPATH_SEPERATOR_CHARACTER);
cover_path.AppendCharacter(FS_OSPATH_SEPARATOR_CHARACTER);
cover_path.AppendString("covers");
cover_path.AppendCharacter(FS_OSPATH_SEPERATOR_CHARACTER);
cover_path.AppendCharacter(FS_OSPATH_SEPARATOR_CHARACTER);
cover_path.AppendString(file_title.data(), static_cast<u32>(file_title.size()));
cover_path.AppendCharacter('.');
cover_path.AppendString(extension);
Expand Down
10 changes: 5 additions & 5 deletions src/updater/updater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@ bool Updater::ParseZip()
for (size_t i = 0; i < len; i++)
{
if (zip_filename_buffer[i] == '/' || zip_filename_buffer[i] == '\\')
zip_filename_buffer[i] = FS_OSPATH_SEPERATOR_CHARACTER;
zip_filename_buffer[i] = FS_OSPATH_SEPARATOR_CHARACTER;
}

// should never have a leading slash. just in case.
while (zip_filename_buffer[0] == FS_OSPATH_SEPERATOR_CHARACTER)
while (zip_filename_buffer[0] == FS_OSPATH_SEPARATOR_CHARACTER)
std::memmove(&zip_filename_buffer[1], &zip_filename_buffer[0], --len);

// skip directories (we sort them out later)
if (len > 0 && zip_filename_buffer[len - 1] != FS_OSPATH_SEPERATOR_CHARACTER)
if (len > 0 && zip_filename_buffer[len - 1] != FS_OSPATH_SEPARATOR_CHARACTER)
{
// skip updater itself, since it was already pre-extracted.
if (StringUtil::Strcasecmp(zip_filename_buffer, "updater.exe") != 0)
Expand Down Expand Up @@ -138,10 +138,10 @@ bool Updater::ParseZip()
const size_t len = ftu.destination_filename.length();
for (size_t i = 0; i < len; i++)
{
if (ftu.destination_filename[i] == FS_OSPATH_SEPERATOR_CHARACTER)
if (ftu.destination_filename[i] == FS_OSPATH_SEPARATOR_CHARACTER)
{
std::string dir(ftu.destination_filename.begin(), ftu.destination_filename.begin() + i);
while (!dir.empty() && dir[dir.length() - 1] == FS_OSPATH_SEPERATOR_CHARACTER)
while (!dir.empty() && dir[dir.length() - 1] == FS_OSPATH_SEPARATOR_CHARACTER)
dir.erase(dir.length() - 1);

if (std::find(m_update_directories.begin(), m_update_directories.end(), dir) == m_update_directories.end())
Expand Down

0 comments on commit 7a40a84

Please sign in to comment.