Skip to content

Commit 60598c0

Browse files
committed
Switched to good old C checks:
* Some compilers had problems with `starts_with()`.
1 parent 24ee741 commit 60598c0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/new.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,9 @@ static bool translateRegExp(const char *data, size_t size, bool multiline, std::
152152
std::string name(data + i + 3, j - i - 3);
153153
if (unicodeClasses.find(name) != unicodeClasses.end()) {
154154
name = unicodeClasses[name];
155-
} else if (name.starts_with("Script=")) {
155+
} else if (name.size() > 7 && !strncmp(name.c_str(), "Script=", 7)) {
156156
name = name.substr(7);
157-
} else if (name.starts_with("sc=")) {
157+
} else if (name.size() > 3 && !strncmp(name.c_str(), "sc=", 3)) {
158158
name = name.substr(3);
159159
}
160160
if (name.size() == 1) {

0 commit comments

Comments
 (0)