summaryrefslogtreecommitdiff
path: root/Source/Core/Common
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/Common')
-rw-r--r--Source/Core/Common/Assembler/GekkoLexer.cpp5
-rw-r--r--Source/Core/Common/FileUtil.cpp5
2 files changed, 6 insertions, 4 deletions
diff --git a/Source/Core/Common/Assembler/GekkoLexer.cpp b/Source/Core/Common/Assembler/GekkoLexer.cpp
index 595df5cbf5..3b9fc961ad 100644
--- a/Source/Core/Common/Assembler/GekkoLexer.cpp
+++ b/Source/Core/Common/Assembler/GekkoLexer.cpp
@@ -369,11 +369,8 @@ std::string_view Lexer::CurrentLine() const
size_t begin_index = line_index == 0 ? 0 : line_index - 1;
for (; begin_index > 0; begin_index--)
{
- if (m_lex_string[begin_index] == '\n')
- {
- begin_index++;
+ if (m_lex_string[begin_index - 1] == '\n')
break;
- }
}
size_t end_index = begin_index;
for (; end_index < m_lex_string.size(); end_index++)
diff --git a/Source/Core/Common/FileUtil.cpp b/Source/Core/Common/FileUtil.cpp
index 053614f31f..ba52f63094 100644
--- a/Source/Core/Common/FileUtil.cpp
+++ b/Source/Core/Common/FileUtil.cpp
@@ -740,6 +740,11 @@ std::string GetExePath()
if (sysctl(name, 4, dolphin_exe_path.data(), &length, nullptr, 0) != 0)
return {};
return dolphin_exe_path;
+#elif defined(__OpenBSD__) && defined(HAVE_GETEXECPATH)
+ char dolphin_exe_path[PATH_MAX];
+ if (getexecpath(dolphin_exe_path, sizeof(dolphin_exe_path)) != 0)
+ return {};
+ return dolphin_exe_path;
#else
char dolphin_exe_path[PATH_MAX];
ssize_t len = ::readlink("/proc/self/exe", dolphin_exe_path, sizeof(dolphin_exe_path));