<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>test/simple-minus.gif</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -143,7 +143,7 @@ module MiniMagick
     def run_command(command, *args)
       args.collect! do |arg|        
         # args can contain characters like '&gt;' so we must escape them, but don't quote switches
-        if arg !~ /^\+|\-/
+        if arg !~ /^[\+\-]/
           &quot;\&quot;#{arg}\&quot;&quot;
         else
           arg.to_s</diff>
      <filename>lib/mini_magick.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,6 +7,7 @@ class ImageTest &lt; Test::Unit::TestCase
   CURRENT_DIR = File.dirname(File.expand_path(__FILE__)) + &quot;/&quot;
 
   SIMPLE_IMAGE_PATH = CURRENT_DIR + &quot;simple.gif&quot;
+  MINUS_IMAGE_PATH = CURRENT_DIR + &quot;simple-minus.gif&quot;
   TIFF_IMAGE_PATH = CURRENT_DIR + &quot;leaves.tiff&quot;
   NOT_AN_IMAGE_PATH = CURRENT_DIR + &quot;not_an_image.php&quot;
   GIF_WITH_JPG_EXT = CURRENT_DIR + &quot;actually_a_gif.jpg&quot;
@@ -105,6 +106,15 @@ class ImageTest &lt; Test::Unit::TestCase
     assert_equal 30, image[:height]
     assert_match(/^gif$/i, image[:format])
   end
+  
+  def test_image_combine_options_with_filename_with_minusses_in_it
+    image = Image.from_file(SIMPLE_IMAGE_PATH)
+    assert_nothing_raised do
+      image.combine_options do |c|
+        c.draw &quot;image Over 0,0 10,10 '#{MINUS_IMAGE_PATH}'&quot;
+      end
+    end
+  end
 
   def test_exif
     image = Image.from_file(EXIF_IMAGE_PATH)</diff>
      <filename>test/image_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>9596bdc4fafaa77b88d3fdcdce26d0df5861adac</id>
    </parent>
  </parents>
  <author>
    <name>Jan Krutisch</name>
    <email>jan@krutisch.de</email>
  </author>
  <url>http://github.com/probablycorey/mini_magick/commit/63af4ba4f02432673f80388912d31a24c8bedc9c</url>
  <id>63af4ba4f02432673f80388912d31a24c8bedc9c</id>
  <committed-date>2009-08-05T11:15:28-07:00</committed-date>
  <authored-date>2009-07-29T05:09:17-07:00</authored-date>
  <message>run_command was using a wrong regular expression to check for switches

The regex /^\+|\-/ unfortunately does match as soon as the whole given options
contain any - in it, because the ^ in the given regex only counts for the +,
but not for the -. This broke our code in a place where we were overlaying
an image with another image and the given image had minuesses in it.

I added a test to explain both the problem and the fix.

Signed-off-by: Corey &lt;probablycorey@gmail.com&gt;</message>
  <tree>9f6aa6d77bd852c26a87f4f2e3ca5c5175fd4110</tree>
  <committer>
    <name>Corey</name>
    <email>probablycorey@gmail.com</email>
  </committer>
</commit>
