-
Notifications
You must be signed in to change notification settings - Fork 452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scheduler: allow negation of regular expressions in plan class XML specs (standard) #4529
base: dpa_regex
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,13 +33,17 @@ int REGEX_CLAUSE::init(const char* p) { | |
present = true; | ||
negate = false; | ||
expr = p; | ||
if (*p == '!') { | ||
p++; | ||
if (!strncmp(p,"(?!",3) && p[strlen(p)-1] == ')') { | ||
p += 3; | ||
p[strlen(p)-1] = '\0'; // don't parse trailing ')' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At this point data at |
||
negate = true; | ||
} | ||
if (regcomp(®ex, p, REG_EXTENDED|REG_NOSUB) ) { | ||
return ERR_XML_PARSE; | ||
} | ||
if (negate) { | ||
p[strlen(p)] = ')'; // restore trailing ')' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here the same as above: data stored in |
||
} | ||
return 0; | ||
} | ||
|
||
|
There was a problem hiding this comment.
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