Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions sched/plan_class_spec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,17 @@ int REGEX_CLAUSE::init(const char* p) {
present = true;
negate = false;
expr = p;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here copy constructor will be called

if (*p == '!') {
p++;
if (!strncmp(p,"(?!",3) && p[strlen(p)-1] == ')') {
p += 3;
p[strlen(p)-1] = '\0'; // don't parse trailing ')'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point data at expr will not be changed, because you're modifying the original data piece that has nothing common with expr at all.
If this is done by intention - then it's fine.

negate = true;
}
if (regcomp(&regex, p, REG_EXTENDED|REG_NOSUB) ) {
return ERR_XML_PARSE;
}
if (negate) {
p[strlen(p)] = ')'; // restore trailing ')'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here the same as above: data stored in expr will not be modified.

}
return 0;
}

Expand Down