ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Archit Shah <as...@arsdigita.com>
Subject update to Patch for Execute task on OS X
Date Fri, 20 Apr 2001 17:35:50 GMT
As per Conor's suggestion, I have changed Execute.java to parse
out the major version as an int insteading parsing the "os.version"
property as a float.

 -- Archit

--- Execute.java.submitted      Fri Apr 20 10:17:37 2001
+++ Execute.java        Fri Apr 20 10:22:14 2001
@@ -181,8 +181,11 @@
             // Mac
             // Determine if we are running under OS X
             try {
-                float version = Float.parseFloat(System.getProperty("os.version"));
-                if (version >= 10.0) {
+                String version = System.getProperty("os.version");
+                int majorVersion = Integer.parseInt(
+                    version.substring(0, version.indexOf('.')));
+
+                if (majorVersion >= 10) {
                     // OS X - just line UNIX
                     String[] cmd = {"/usr/bin/env"};
                     return cmd;

Mime
View raw message