[Nice-commit] Nice/src/nice/tools/repository main.nice,1.2,1.3
Brought to you by:
bonniot
From: Daniel B. <bo...@us...> - 2004-10-06 09:38:22
|
Update of /cvsroot/nice/Nice/src/nice/tools/repository In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2837/src/nice/tools/repository Modified Files: main.nice Log Message: Do not fail when the URL does not contain a repository part. Index: main.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/repository/main.nice,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** main.nice 14 Sep 2004 16:00:31 -0000 1.2 --- main.nice 6 Oct 2004 09:38:00 -0000 1.3 *************** *** 67,71 **** openConnection(URL url) { ! (URL repo, String resource, ?String ver) = parseRepoURL(url); let pkg = getPackage(resource); --- 67,74 ---- openConnection(URL url) { ! (?URL repo, String resource, ?String ver) = parseRepoURL(url); ! if (repo == null) ! return null; ! let pkg = getPackage(resource); *************** *** 89,96 **** } ! (URL,String,?String) parseRepoURL(URL url) { String s = url.toString(); int sep = s.indexOf('!'); URL repo = new URL(s.substring(0, sep)); int pver = s.indexOf('#', sep); --- 92,103 ---- } ! (?URL,String,?String) parseRepoURL(URL url) { String s = url.toString(); int sep = s.indexOf('!'); + if (sep == -1) + // This is not a valid URL inside a repository + return (null, "", null); + URL repo = new URL(s.substring(0, sep)); int pver = s.indexOf('#', sep); |