module Rake::AltSystem

def repair_command(cmd)

def repair_command(cmd)
  "call " + (
    if cmd =~ %r!\A\s*\".*?\"!
      # already quoted
      cmd
    elsif match = cmd.match(%r!\A\s*(\S+)!)
      if match[1] =~ %r!/!
        # avoid x/y.bat interpretation as x with option /y
        %Q!"#{match[1]}"! + match.post_match
      else
        # a shell command will fail if quoted
        cmd
      end
    else
      # empty or whitespace
      cmd
    end
  )
end