From 02c4bbfc58bd9c7eefa020455c5eb547376f0849 Mon Sep 17 00:00:00 2001 From: zzz Date: Wed, 16 Mar 2011 03:01:32 +0000 Subject: [PATCH] fix filtering --- .../src/net/i2p/client/naming/SingleFileNamingService.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/java/src/net/i2p/client/naming/SingleFileNamingService.java b/core/java/src/net/i2p/client/naming/SingleFileNamingService.java index f00102c46..30722a04f 100644 --- a/core/java/src/net/i2p/client/naming/SingleFileNamingService.java +++ b/core/java/src/net/i2p/client/naming/SingleFileNamingService.java @@ -310,21 +310,22 @@ public class SingleFileNamingService extends NamingService { searchOpt = options.getProperty("search"); startsWith = options.getProperty("startsWith"); } + if (_log.shouldLog(Log.DEBUG)) + _log.debug("Searching " + " starting with " + startsWith + " search string " + searchOpt); BufferedReader in = null; getReadLock(); try { in = new BufferedReader(new InputStreamReader(new FileInputStream(_file), "UTF-8"), 16*1024); String line = null; - String search = startsWith == null ? null : startsWith + '='; Map rv = new HashMap(); while ( (line = in.readLine()) != null) { if (line.length() <= 0) continue; - if (search != null) { + if (startsWith != null) { if (startsWith.equals("[0-9]")) { if (line.charAt(0) < '0' || line.charAt(0) > '9') continue; - } else if (!line.startsWith(search)) { + } else if (!line.startsWith(startsWith)) { continue; } }