Skip to content

Commit 23e334e

Browse files
committed
fix: Substring Command Line Parameters
When reading command line parameters, the `-` and `=` characters weren't being considered. This caused the command line arguments to always be 2 characters too long, generally the last character and the `=` at the end. This fixes it by adding a constant 2 characters to the substring length.
1 parent fff90a7 commit 23e334e

File tree

1 file changed

+3
-1
lines changed
  • lib/NativeCode/DynamicLibraryLoaderHelper/NativeRender/include

1 file changed

+3
-1
lines changed

lib/NativeCode/DynamicLibraryLoaderHelper/NativeRender/include/io_helpers.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,10 @@ namespace pew::eos::io_helpers
125125
if (match != nullptr)
126126
{
127127
// extract the value.
128+
// The argument should have started with "-" and continued with "=",
129+
// so it needs to be substringed the length of the match plus these two characters
128130
std::string arg_value;
129-
arg_value = argument.substr(match->length());
131+
arg_value = argument.substr(match->length() + 2);
130132

131133
if (!arg_value.empty())
132134
{

0 commit comments

Comments
 (0)