*) Fixed bug where pairReplace() got caught in infinite recursion. (http://www.yacy-forum.de/viewtopic.php?t=3466)

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3383 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
low012 18 years ago
parent c8862e47fb
commit 801eea8849

@ -1026,9 +1026,8 @@ public class wikiCode {
int p0 = 0;
int p1 = 0;
int l = pat.length();
if ((p0 = input.indexOf(pat)) >= 0) {
p1 = input.indexOf(pat, p0 + l);
if (p1 >= 0) {
//replace pattern if a pair of the pattern can be found in the line
if( ((p0 = input.indexOf(pat)) >= 0) && ((p1 = input.indexOf(pat, p0 + l)) >= 0) ) {
//extra treatment for headlines
if((pat.equals("===="))||(pat.equals("==="))||(pat.equals("=="))){
//add anchor and create headline
@ -1059,9 +1058,10 @@ public class wikiCode {
input.substring(p1 + l);
}
}
//recursion if a pair of the pattern can still be found in the line
if( ((p0 = input.indexOf(pat)) >= 0) && (input.indexOf(pat,p0 + l) >= 0) ){
input = pairReplace(input, pat, repl1, repl2);
}
//recursion if the pattern can still be found in the line
if(input.indexOf(pat) >= 0) {input = pairReplace(input, pat, repl1, repl2);}
return input;
}

Loading…
Cancel
Save