File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -138,7 +138,8 @@ void json_compiler::compile_container(
138
138
bool is_knot = name_override != " " && index_in_parent == -1 ;
139
139
if (is_knot) {
140
140
// it is not a wave or choice
141
- if (name_override.starts_with (" c-" ) || name_override.starts_with (" g-" )) {
141
+ if (::ink::internal::starts_with (name_override.c_str (), " c-" ) ||
142
+ ::ink::internal::starts_with (name_override.c_str(), "g-")) {
142
143
is_knot = false ;
143
144
for (auto itr = name_override.begin () + 2 ; itr != name_override.end (); ++itr) {
144
145
if (*itr > ' 9' || *itr < ' 0' ) {
Original file line number Diff line number Diff line change @@ -97,6 +97,19 @@ constexpr list_flag empty_flag{-1, 0};
97
97
98
98
namespace internal
99
99
{
100
+ /* * Checks if a string starts with a given prefix*/
101
+ static bool starts_with (const char * string, const char * prefix)
102
+ {
103
+ while (*prefix) {
104
+ if (*string != *prefix) {
105
+ return false ;
106
+ }
107
+ string++;
108
+ prefix++;
109
+ }
110
+ return true ;
111
+ }
112
+
100
113
/* * Checks if a string is only whitespace*/
101
114
static bool is_whitespace (const char * string, bool includeNewline = true )
102
115
{
You can’t perform that action at this time.
0 commit comments