[Rt-devel] PATCH: submission of '0' via REST interface

Jesse Vincent jesse at bestpractical.com
Mon Apr 24 11:08:00 EDT 2006


I'll take this one if you add a comment to the code. While the current
REST code isn't great, this makes it even harder to read ;)


On Fri, Apr 21, 2006 at 04:02:55PM +0200, David Schweikert wrote:
> Hi,
> 
> The following patch fixes a problem in the REST interface: currently it
> is not possible to submit '0' as a value (because of it being "false" in
> Perl). It means that it is for example not possible to set a priority to
> 0 via the rt command-line.
> 
> 
> --- RT/Interface/REST.pm	2006-04-21 15:46:18.693515000 +0200
> +++ RT/Interface/REST.pm	2006-04-21 15:58:24.703729000 +0200
> @@ -110,8 +110,8 @@
>              }
>              elsif ($state <= 1 && $line =~ /^($field):(?:\s+(.*))?$/) {
>                  # Read a field: value specification.
> -                my $f  = $1;
> -                my @v  = ($2 || ());
> +                my ($f, $vtmp) = ($1, $2);
> +                my @v = ($vtmp =~ /\S/ ? ($vtmp) : ());
>  
>                  # Read continuation lines, if any.
>                  while (@lines && ($lines[0] eq '' || $lines[0] =~ /^\s+/)) {
> 
> 
> Cheers
> David
> -- 
> David Schweikert        | phone: +41 44 632 7019
> System manager ISG.EE   | walk:  ETH Zentrum, ETL F24.1
> ETH Zurich, Switzerland | web:   http://people.ee.ethz.ch/dws
> _______________________________________________
> List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel
> 
> Best Practical is hiring! Come hack Perl for us: http://bestpractical.com/about/jobs.html
> 

-- 


More information about the Rt-devel mailing list