[libbluray-devel] Fixed relative path check for Windows
Rik Smith
git at videolan.org
Thu Apr 11 18:06:43 CEST 2013
libbluray | branch: master | Rik Smith <webmaster at rsmith.nl> | Thu Apr 11 18:40:06 2013 +0300| [e06d59de0ed2a73944864875d9eaadca920ee98f] | committer: hpi1
Fixed relative path check for Windows
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=e06d59de0ed2a73944864875d9eaadca920ee98f
---
src/libbluray/bdj/java-j2me/java/awt/BDToolkit.java | 3 ++-
src/libbluray/bdj/java-j2se/java/awt/BDToolkit.java | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/libbluray/bdj/java-j2me/java/awt/BDToolkit.java b/src/libbluray/bdj/java-j2me/java/awt/BDToolkit.java
index b5698c4..6e97932 100644
--- a/src/libbluray/bdj/java-j2me/java/awt/BDToolkit.java
+++ b/src/libbluray/bdj/java-j2me/java/awt/BDToolkit.java
@@ -22,6 +22,7 @@ package java.awt;
import java.awt.image.ColorModel;
import java.awt.image.ImageObserver;
import java.awt.image.ImageProducer;
+import java.io.File;
import java.net.URL;
import java.util.Collections;
import java.util.Hashtable;
@@ -134,7 +135,7 @@ public class BDToolkit extends Toolkit {
}
public Image createImage(String filename) {
- if (filename.charAt(0) != '/') {
+ if (!new File(filename).exists()) {
BDJXletContext ctx = BDJXletContext.getCurrentContext();
if (ctx != null) {
ClassLoader cldr = (ClassLoader)ctx.getClassLoader();
diff --git a/src/libbluray/bdj/java-j2se/java/awt/BDToolkit.java b/src/libbluray/bdj/java-j2se/java/awt/BDToolkit.java
index b71dfc7..da8a589 100644
--- a/src/libbluray/bdj/java-j2se/java/awt/BDToolkit.java
+++ b/src/libbluray/bdj/java-j2se/java/awt/BDToolkit.java
@@ -24,6 +24,7 @@ import java.awt.image.ColorModel;
import java.awt.image.ImageObserver;
import java.awt.image.ImageProducer;
import java.awt.peer.KeyboardFocusManagerPeer;
+import java.io.File;
import java.net.URL;
import java.util.Collections;
import java.util.Hashtable;
@@ -155,7 +156,7 @@ public class BDToolkit extends Toolkit implements KeyboardFocusManagerPeerProvid
}
public Image createImage(String filename) {
- if (filename.charAt(0) != '/') {
+ if (!new File(filename).exists()) {
BDJXletContext ctx = BDJXletContext.getCurrentContext();
if (ctx != null) {
ClassLoader cldr = (ClassLoader)ctx.getClassLoader();
More information about the libbluray-devel
mailing list