[Rt-commit] rt branch, 4.2/cli-form-parse-zero-value-fix, created. rt-4.2.12-75-g7a15c5b

? sunnavy sunnavy at bestpractical.com
Thu Oct 22 12:37:26 EDT 2015


The branch, 4.2/cli-form-parse-zero-value-fix has been created
        at  7a15c5b4e3c6209493de988c914840c6b6c3d206 (commit)

- Log -----------------------------------------------------------------
commit 7a15c5b4e3c6209493de988c914840c6b6c3d206
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Oct 23 00:32:02 2015 +0800

    value 0 should be respected
    
    we may get errors like "# TimeWorked: That is already the current value" and vi
    being popped up for a few times without this.
    
    Fixes: I#31290

diff --git a/bin/rt.in b/bin/rt.in
index ee60033..deead6f 100644
--- a/bin/rt.in
+++ b/bin/rt.in
@@ -1293,7 +1293,7 @@ sub Form::parse {
             elsif ($state <= 1 && $line =~ /^($field):(?:\s+(.*))?$/) {
                 # Read a field: value specification.
                 my $f  = $1;
-                my @v  = ($2 || ());
+                my @v  = (defined $2 && length $2 ? $2 : ());
 
                 # Read continuation lines, if any.
                 while (@lines && ($lines[0] eq '' || $lines[0] =~ /^\s+/)) {

-----------------------------------------------------------------------


More information about the rt-commit mailing list