Fixed problem with NOQUOTE string replacement.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4627 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
269a111ddb
commit
94d825c1a8
1 changed files with 11 additions and 5 deletions
|
|
@ -582,8 +582,10 @@ replace_simple(String *str, char *token, char *rep, int flags, int count, char *
|
||||||
if (!q2) {
|
if (!q2) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (q2 > s)
|
if (q2 > s) {
|
||||||
|
/* Find next match */
|
||||||
s = (*match)(base,q2+1,token,tokenlen);
|
s = (*match)(base,q2+1,token,tokenlen);
|
||||||
|
}
|
||||||
if (!s) return 0; /* Oh well, no matches */
|
if (!s) return 0; /* Oh well, no matches */
|
||||||
q = strpbrk(q2+1,"\"\'");
|
q = strpbrk(q2+1,"\"\'");
|
||||||
if (!q) noquote = 0; /* No more quotes */
|
if (!q) noquote = 0; /* No more quotes */
|
||||||
|
|
@ -676,10 +678,12 @@ replace_simple(String *str, char *token, char *rep, int flags, int count, char *
|
||||||
c = 0;
|
c = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (q2 > c)
|
if (q2 > c) {
|
||||||
c = (*match)(base,q2+1,token,tokenlen);
|
c = (*match)(base,q2+1,token,tokenlen);
|
||||||
if (!c) break;
|
if (!c) break;
|
||||||
|
}
|
||||||
q = strpbrk(q2+1,"\"\'");
|
q = strpbrk(q2+1,"\"\'");
|
||||||
|
if (!q) noquote = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -691,6 +695,7 @@ replace_simple(String *str, char *token, char *rep, int flags, int count, char *
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
expand = delta*rcount; /* Total amount of expansion for the replacement */
|
expand = delta*rcount; /* Total amount of expansion for the replacement */
|
||||||
newsize = str->maxsize;
|
newsize = str->maxsize;
|
||||||
while ((str->len + expand) >= newsize) newsize *= 2;
|
while ((str->len + expand) >= newsize) newsize *= 2;
|
||||||
|
|
@ -722,9 +727,10 @@ replace_simple(String *str, char *token, char *rep, int flags, int count, char *
|
||||||
c = 0;
|
c = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (q2 > c)
|
if (q2 > c) {
|
||||||
c = (*match)(base,q2+1,token,tokenlen);
|
c = (*match)(base,q2+1,token,tokenlen);
|
||||||
if (!c) break;
|
if (!c) break;
|
||||||
|
}
|
||||||
q = strpbrk(q2+1,"\"\'");
|
q = strpbrk(q2+1,"\"\'");
|
||||||
if (!q) noquote = 0; /* No more quotes */
|
if (!q) noquote = 0; /* No more quotes */
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue