[Android] Fix a crash in URItoFileName and behave like the method name says

Jean-Baptiste Kempf git at videolan.org
Tue Oct 2 17:16:01 CEST 2012


vlc-ports/android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Tue Oct  2 17:10:26 2012 +0200| [0711b73d1cd6e5e5e1656b9ba5c475495aac9f1b] | committer: Jean-Baptiste Kempf

Fix a crash in URItoFileName and behave like the method name says

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=0711b73d1cd6e5e5e1656b9ba5c475495aac9f1b
---

 vlc-android/src/org/videolan/vlc/Util.java |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/Util.java b/vlc-android/src/org/videolan/vlc/Util.java
index 56f1b8d..8eb227e 100644
--- a/vlc-android/src/org/videolan/vlc/Util.java
+++ b/vlc-android/src/org/videolan/vlc/Util.java
@@ -72,10 +72,7 @@ public class Util {
     }
 
     public static String URItoFileName(String URI) {
-        int sep = URI.lastIndexOf('/');
-        int dot = URI.lastIndexOf('.');
-        String name = dot >= 0 ? URI.substring(sep + 1, dot) : URI;
-        return Uri.decode(name);
+        return URItoFile(URI).getName();
     }
 
     public static String PathToURI(String path) {



More information about the Android mailing list