Fix the matching of strings on windows to use regex
authorPeter Donald <donaldp@apache.org>
Sat, 20 Oct 2012 11:41:45 +0000 (11:41 +0000)
committerPeter Donald <donaldp@apache.org>
Sat, 20 Oct 2012 11:41:45 +0000 (11:41 +0000)
git-svn-id: https://svn.apache.org/repos/asf/buildr/trunk@1400422 13f79535-47bb-0310-9956-ffa450edef68

lib/buildr/java/commands.rb

index 0de1572..3ec00e2 100644 (file)
@@ -62,7 +62,7 @@ module Java
             # If our cmd line is longer, we create a batch file and execute it instead.
           if Util.win_os? &&  cmd_args.map(&:inspect).join(' ').size > 2048
             # remove '-classpath' and the classpath itself from the cmd line.
-            cp_i = cmd_args.index{|x| x.starts_with('-classpath')}
+            cp_i = cmd_args.index{|x| x.to_s =~ /^-classpath/}
             2.times do
               cmd_args.delete_at cp_i unless cp_i.nil?
             end