I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 6afc64ac authored by jrandom's avatar jrandom Committed by zzz
Browse files

deal with locations that have : in them (aka http://glog.i2p/archive/archive.txt)

parent 61b8e359
No related branches found
No related tags found
No related merge requests found
......@@ -76,15 +76,11 @@ public class PetName {
_groups.add(gtok.nextToken().trim());
s = tok.nextToken(); // skip past the :
}
if (tok.hasMoreTokens()) {
s = tok.nextToken();
if (":".equals(s)) {
_location = null;
} else {
_location = s;
}
} else {
_location = null;
while (tok.hasMoreTokens()) {
if (_location == null)
_location = tok.nextToken();
else
_location = _location + tok.nextToken();
}
}
......@@ -161,15 +157,16 @@ public class PetName {
}
public static void main(String args[]) {
test("a:b:c:d:e:f");
test("a:::::d");
test("a:::::");
test("a:b::::");
test(":::::");
test("a:b:c:true:e:f");
test("a:::true::d");
test("a:::true::");
test("a:b::true::");
test(":::trye::");
test("a:b:c:true:e:http://foo.bar");
}
private static void test(String line) {
PetName pn = new PetName(line);
String val = pn.toString();
System.out.println("OK? " + val.equals(line) + ": " + line);
System.out.println("OK? " + val.equals(line) + ": " + line + " [" + val + "]");
}
}
......@@ -98,7 +98,8 @@ public class User {
public PetNameDB getPetNameDB() { return _petnames; }
public void invalidate() {
BlogManager.instance().saveUser(this);
if (_authenticated)
BlogManager.instance().saveUser(this);
init();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment