<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -16,7 +16,12 @@ module Clickatell
           raise Clickatell::API::Error.parse(http_response.body)
         end
         results = http_response.body.split(&quot;\n&quot;).map do |line|
-          YAML.load(line.scan(PARSE_REGEX).join(&quot;\n&quot;))
+          # YAML.load converts integer strings that have leading zeroes into integers
+          # using octal rather than decimal.  This isn't what we want, so we'll strip out any
+          # leading zeroes in numbers here.
+          response_fields = line.scan(PARSE_REGEX)
+          response_fields = response_fields.collect { |field| field.gsub(/\b0+(\d+)\b/, '\1') }
+          YAML.load(response_fields.join(&quot;\n&quot;))
         end
         results.length == 1 ? results.first : results
       end</diff>
      <filename>lib/clickatell/response.rb</filename>
    </modified>
    <modified>
      <diff>@@ -23,6 +23,16 @@ module Clickatell
     it &quot;should raise API::Error if response contains an error message&quot; do
       proc { Response.parse(stub('response', :body =&gt; 'ERR: 001, Authentication failed')) }.should raise_error(Clickatell::API::Error)
     end
+
+    {
+      '001' =&gt; 1, '002' =&gt; 2,  '003' =&gt; 3,  '004' =&gt; 4,
+      '005' =&gt; 5, '006' =&gt; 6,  '007' =&gt; 7,  '008' =&gt; 8,
+      '009' =&gt; 9, '010' =&gt; 10, '011' =&gt; 11, '012' =&gt; 12
+    }.each do |status_str, status_int|
+      it &quot;should parse a message status code of #{status_int} when the response body contains a status code of #{status_str}&quot; do
+        Response.parse(stub('response', :body =&gt; &quot;ID: 0d1d7dda17d5a24edf1555dc0b679d0e Status: #{status_str}&quot;)).should == {'ID' =&gt; '0d1d7dda17d5a24edf1555dc0b679d0e', 'Status' =&gt; status_int}
+      end
+    end
     
     describe &quot;in test mode&quot; do
       before(:each) do</diff>
      <filename>spec/response_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>6f956cac0dd9273111023c08a9ff8962fb896bd8</id>
    </parent>
  </parents>
  <author>
    <name>Luke Redpath</name>
    <email>contact@lukeredpath.co.uk</email>
  </author>
  <url>http://github.com/lukeredpath/clickatell/commit/6a7713ee95629f73f5f042ab392e52a304db1011</url>
  <id>6a7713ee95629f73f5f042ab392e52a304db1011</id>
  <committed-date>2009-10-07T02:30:18-07:00</committed-date>
  <authored-date>2009-10-07T02:30:18-07:00</authored-date>
  <message>Fixed octal parsing bug. Squashed commit of the following:

commit 588781ca78e45dc0a39d8879687c124dc2e1de16
Author: Myron Marston &lt;myron.marston@gmail.com&gt;
Date:   Tue Oct 6 19:17:35 2009 -0700

    Fixed bug in response parser.  Integer strings that have leading zeroes get converted to integers using base 8 by YAML.load.  To fix this, I just removed leading zeroes from these strings before calling YAML.load.

commit 304e7ab688d9acffc2ba3849d88e140070b86987
Author: Myron Marston &lt;myron.marston@gmail.com&gt;
Date:   Tue Oct 6 19:13:34 2009 -0700

    Added failing spec for a bug I'm seeing.  The response parser parses the message status code using octal instead of decimal.</message>
  <tree>16026a80cef15f8e7a75d1291757764777c17718</tree>
  <committer>
    <name>Luke Redpath</name>
    <email>contact@lukeredpath.co.uk</email>
  </committer>
</commit>
