replace 'strstr(xxx,"x_") == xxx' with utils::strmatch("^x_")

This commit is contained in:
Axel Kohlmeyer
2021-02-04 15:20:43 -05:00
parent 3e07711739
commit 4e791ac4f7
35 changed files with 163 additions and 163 deletions

View File

@ -3309,7 +3309,7 @@ tagint Variable::int_between_brackets(char *&ptr, int varallow)
char *start = ++ptr;
if (varallow && strstr(ptr,"v_") == ptr) {
if (varallow && utils::strmatch(ptr,"^v_")) {
varflag = 1;
while (*ptr && *ptr != ']') {
if (!isalnum(*ptr) && *ptr != '_')
@ -4112,7 +4112,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree,
// argument is compute
if (strstr(args[0],"c_") == args[0]) {
if (utils::strmatch(args[0],"^c_")) {
ptr1 = strchr(args[0],'[');
if (ptr1) {
ptr2 = ptr1;
@ -4157,7 +4157,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree,
// argument is fix
} else if (strstr(args[0],"f_") == args[0]) {
} else if (utils::strmatch(args[0],"^f_")) {
ptr1 = strchr(args[0],'[');
if (ptr1) {
ptr2 = ptr1;
@ -4195,7 +4195,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree,
// argument is vector-style variable
} else if (strstr(args[0],"v_") == args[0]) {
} else if (utils::strmatch(args[0],"^v_")) {
ptr1 = strchr(args[0],'[');
if (ptr1) {
ptr2 = ptr1;