[asterisk-bugs] [Asterisk 0014670]: FILE function reads 1 character less than specified in length

Asterisk Bug Tracker noreply at bugs.digium.com
Sun Mar 15 13:46:47 CDT 2009


The following issue has been SUBMITTED. 
====================================================================== 
http://bugs.digium.com/view.php?id=14670 
====================================================================== 
Reported By:                BMC
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   14670
Category:                   Functions/func_env
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
Asterisk Version:           1.6.0.6 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2009-03-15 13:46 CDT
Last Modified:              2009-03-15 13:46 CDT
====================================================================== 
Summary:                    FILE function reads 1 character less than specified
in length
Description: 
The replacement of ReadFile does not work as specified:

cat /tmp/test.txt
123456789

exten => s,n,ReadFile(VAR1=/tmp/test.txt,2);
exten => s,n,NoOp(VAR1=${VAR1});
exten => s,n,Set(VAR2=${FILE(/tmp/test.txt,0,2)});
exten => s,n,NoOp(VAR2=${VAR2});

    -- Executing [s at test:2] ReadFile("mISDN/3-u46",
"VAR1=/tmp/test.txt,2") in new stack
    -- Executing [s at test:3] NoOp("mISDN/3-u46", "VAR1=12") in new stack
    -- Executing [s at test:4] Set("mISDN/3-u46", "VAR2=1") in new stack
    -- Executing [s at test:5] NoOp("mISDN/3-u46", "VAR2=1") in new stack


====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-03-15 13:46 BMC            New Issue                                    
2009-03-15 13:46 BMC            Asterisk Version          => 1.6.0.6         
2009-03-15 13:46 BMC            Regression                => No              
2009-03-15 13:46 BMC            SVN Branch (only for SVN checkouts, not tarball
releases) =>  trunk          
======================================================================




More information about the asterisk-bugs mailing list