[asterisk-bugs] [Asterisk 0015320]: [patch] CUT() returns empty string for fields other than the 1st

Asterisk Bug Tracker noreply at bugs.digium.com
Thu Jun 18 13:24:24 CDT 2009


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=15320 
====================================================================== 
Reported By:                chappell
Assigned To:                tilghman
====================================================================== 
Project:                    Asterisk
Issue ID:                   15320
Category:                   Functions/func_cut
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     feedback
Asterisk Version:           SVN 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 200142 
Request Review:              
====================================================================== 
Date Submitted:             2009-06-12 13:31 CDT
Last Modified:              2009-06-18 13:24 CDT
====================================================================== 
Summary:                    [patch] CUT() returns empty string for fields other
than the 1st
Description: 
CUT() in 1.4.X works correctly.  In 1.6.X SVN it does not work due to an
off-by-one error in the code which advances the pointer to the start of the
range.
======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
related to          0015208 [patch] The CUT function does not show ...
====================================================================== 

---------------------------------------------------------------------- 
 (0106673) chappell (reporter) - 2009-06-18 13:24
 https://issues.asterisk.org/view.php?id=15320#c106673 
---------------------------------------------------------------------- 
Response to tilghman's points:

1) I have attached new patches, cut_fix.patch and cut_clarify.patch.  They
are against revision 200620.

2) I have downloaded and examined the latest 1.6.0 and 1.6.1 releases.  It
appears to me that the change which introduced the bug was not committed to
these branches.

3) Though at first glance at the patch it may look like I removed those
cases, I did not.  What I did was change the names of the variables which
indicate the start and end of the range to be extracted.

I also changed the -N case to set num1 (now start_field) to 1 rather than
0.  Setting it to 0 served no purpose and required additional tests later
on to compensate.  By fixing this off-by-one problem, I was able to
eliminate unnecessary tests. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-06-18 13:24 chappell       Note Added: 0106673                          
======================================================================




More information about the asterisk-bugs mailing list