[Rt-commit] r11477 - rt/branches/3.6-RELEASE/lib/RT/Interface

ruz at bestpractical.com ruz at bestpractical.com
Thu Apr 3 23:55:04 EDT 2008


Author: ruz
Date: Thu Apr  3 23:55:03 2008
New Revision: 11477

Modified:
   rt/branches/3.6-RELEASE/lib/RT/Interface/REST.pm

Log:
* allow to set 0 as CF value via CLI, thanks to David Schweikert

Modified: rt/branches/3.6-RELEASE/lib/RT/Interface/REST.pm
==============================================================================
--- rt/branches/3.6-RELEASE/lib/RT/Interface/REST.pm	(original)
+++ rt/branches/3.6-RELEASE/lib/RT/Interface/REST.pm	Thu Apr  3 23:55:03 2008
@@ -125,7 +125,8 @@
             elsif ($state <= 1 && $line =~ /^($field):(?:\s+(.*))?$/i) {
                 # Read a field: value specification.
                 my $f  = $1;
-                my @v  = ($2 || ());
+                my @v  = ($2);
+                $v[0] = '' unless defined $v[0];
 
                 # Read continuation lines, if any.
                 while (@lines && ($lines[0] eq '' || $lines[0] =~ /^\s+/)) {
@@ -140,6 +141,8 @@
                 }
                 s/^$ws// foreach @v;
 
+                shift @v while (@v && $v[0] eq '');
+
                 push(@$o, $f) unless exists $k->{$f};
                 vpush($k, $f, join("\n", @v));
 


More information about the Rt-commit mailing list