From 50de466282a1bf955181cf49322e18a3f05a973d Mon Sep 17 00:00:00 2001 From: eyedeekay Date: Mon, 8 Jul 2024 17:08:48 -0400 Subject: [PATCH] Don't search the whole home directory for usable Firefoxes --- src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java b/src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java index fbf1933..62a75cf 100644 --- a/src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java +++ b/src/java/net/i2p/i2pfirefox/I2PCommonBrowser.java @@ -608,11 +608,16 @@ public class I2PCommonBrowser { } public File userHomeDir() { - File hd = new File(System.getProperty("user.dir")); - if (hd == null || !hd.exists()) { - hd = new File(System.getProperty("user.home")); + File rd = new File(System.getProperty("user.dir")); + File hd = new File(System.getProperty("user.home")); + if (rd == null || !rd.exists()) { + if (hd == null || !hd.exists()) { + if (rd.getAbsolutePath().equals(hd.getAbsolutePath())) + return null; + } + return rd; } - logger.info("Runtime directory discovered at: " + hd); - return hd; + logger.info("Runtime directory discovered at: " + rd); + return rd; } }