From c0f5fc51ef4dc431d0497496d677baf4ad419a8f Mon Sep 17 00:00:00 2001 From: fuchsi Date: Thu, 4 Oct 2007 10:47:48 +0000 Subject: [PATCH] bugfix for last commit git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4142 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/data/htmlTools.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/de/anomic/data/htmlTools.java b/source/de/anomic/data/htmlTools.java index ad5ecd0d2..0d181040d 100644 --- a/source/de/anomic/data/htmlTools.java +++ b/source/de/anomic/data/htmlTools.java @@ -43,18 +43,19 @@ public class htmlTools { */ public static String encode(String text, final String[] map, int spos, int epos) { StringBuffer sb = new StringBuffer(text.length()); - search: while (spos < text.length()) { + int textpos = 0; + search: while (textpos < text.length()) { // find a (forward) mapping loop: for (int i = spos; i < epos; i += 2) { - if (text.charAt(spos) != map[i].charAt(0)) continue loop; + if (text.charAt(textpos) != map[i].charAt(0)) continue loop; // found match sb.append(map[i + 1]); - spos++; + textpos++; continue search; } // not found match sb.append(text.charAt(spos)); - spos++; + textpos++; } return sb.toString();