Bläddra i källkod

URLhandler no longer randomly uses /bin/sh or cmd.exe

Fixes issue 1228

git-svn-id: http://svn.dmdirc.com/trunk@4057 00569f92-eb28-0410-84fd-f71c24880f
tags/0.6
Chris Smith 16 år sedan
förälder
incheckning
55d5f54efa
1 ändrade filer med 2 tillägg och 14 borttagningar
  1. 2
    14
      src/com/dmdirc/util/URLHandler.java

+ 2
- 14
src/com/dmdirc/util/URLHandler.java Visa fil

@@ -127,13 +127,7 @@ public class URLHandler {
127 127
             }
128 128
         }
129 129
 
130
-        if (!config.hasOption("protocol", uri.getScheme())) {
131
-            Main.getUI().showURLDialog(uri);
132
-            return;
133
-        }
134
-
135
-        final String command =
136
-                config.getOption("protocol", uri.getScheme(), "");
130
+        final String command = config.getOption("protocol", uri.getScheme(), "");
137 131
 
138 132
         if (command.isEmpty()) {
139 133
             Main.getUI().showURLDialog(uri);
@@ -229,13 +223,7 @@ public class URLHandler {
229 223
      * @param command Application and arguments
230 224
      */
231 225
     private void execApp(final String command) {
232
-        String[] commandLine;
233
-
234
-        if (System.getProperty("os.name").startsWith("Windows")) {
235
-            commandLine = new String[]{"cmd.exe", command};
236
-        } else {
237
-            commandLine = new String[]{"/bin/sh", "-c", command};
238
-        }
226
+        String[] commandLine = command.split(" ");
239 227
 
240 228
         try {
241 229
             Runtime.getRuntime().exec(commandLine);

Laddar…
Avbryt
Spara