Why not use File.separatorChar?

On Sunday 09 November 2008 18:10, xor at freenetproject.org wrote:
> Author: xor
> Date: 2008-11-09 18:10:38 +0000 (Sun, 09 Nov 2008)
> New Revision: 23447
> 
> Modified:
>    trunk/freenet/src/freenet/pluginmanager/PluginDownLoaderFile.java
> Log:
> Fix loading of plugins from disk on windows.
> 
> Modified: trunk/freenet/src/freenet/pluginmanager/PluginDownLoaderFile.java
> ===================================================================
> --- trunk/freenet/src/freenet/pluginmanager/PluginDownLoaderFile.java 
2008-11-09 17:39:38 UTC (rev 23446)
> +++ trunk/freenet/src/freenet/pluginmanager/PluginDownLoaderFile.java 
2008-11-09 18:10:38 UTC (rev 23447)
> @@ -22,7 +22,10 @@
>  
>       @Override
>       String getPluginName(String source) throws PluginNotFoundException {
> -             return source.substring(source.lastIndexOf('/') + 1);
> +             int slashIndex = source.lastIndexOf('/');
> +             if(slashIndex == -1)
> +                     slashIndex = source.lastIndexOf('\\');
> +             return source.substring(slashIndex + 1);
>       }
>  
>       @Override
> 
> _______________________________________________
> cvs mailing list
> cvs at freenetproject.org
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs
> 
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: not available
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20081111/e7984589/attachment.pgp>

Reply via email to