X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fsquirrel%2Fsqstdlib%2Fsqstdrex.c;h=d7e943662235bd65697fd62f84124b491c63822d;hb=4a54087f52d6a8a2e5b4c498e772685bb0885991;hp=aef9f0f53e46d66fe6bcda267454b1cc6d4367f6;hpb=c81e5d255303f56a3fc33bef1fd0124c4b62cfcf;p=supertux.git diff --git a/src/squirrel/sqstdlib/sqstdrex.c b/src/squirrel/sqstdlib/sqstdrex.c index aef9f0f53..d7e943662 100644 --- a/src/squirrel/sqstdlib/sqstdrex.c +++ b/src/squirrel/sqstdlib/sqstdrex.c @@ -392,7 +392,7 @@ static const SQChar *sqstd_rex_matchnode(SQRex* exp,SQRexNode *node,const SQChar case OP_OR: { const SQChar *asd = str; SQRexNode *temp=&exp->_nodes[node->left]; - while(asd = sqstd_rex_matchnode(exp,temp,asd)) { + while( (asd = sqstd_rex_matchnode(exp,temp,asd)) ) { if(temp->next != -1) temp = &exp->_nodes[temp->next]; else @@ -400,7 +400,7 @@ static const SQChar *sqstd_rex_matchnode(SQRex* exp,SQRexNode *node,const SQChar } asd = str; temp = &exp->_nodes[node->right]; - while(asd = sqstd_rex_matchnode(exp,temp,asd)) { + while( (asd = sqstd_rex_matchnode(exp,temp,asd)) ) { if(temp->next != -1) temp = &exp->_nodes[temp->next]; else @@ -435,10 +435,10 @@ static const SQChar *sqstd_rex_matchnode(SQRex* exp,SQRexNode *node,const SQChar return cur; } case OP_WB: - if(str == exp->_bol && !isspace(*str) + if((str == exp->_bol && !isspace(*str)) || (str == exp->_eol && !isspace(*(str-1))) - || (!isspace(*str) && isspace(*(str+1))) - || (isspace(*str) && !isspace(*(str+1))) ) { + || ((!isspace(*str) && isspace(*(str+1)))) + || ((isspace(*str) && !isspace(*(str+1)))) ) { return (node->left == 'b')?str:NULL; } return (node->left == 'b')?NULL:str;