[CHANGESET]: strtok should default to using all white space characters to match MATLAB

John W. Eaton jwe at bevo.che.wisc.edu
Mon Aug 4 09:59:50 CDT 2008


On  4-Aug-2008, Ben Abbott wrote:

| 
| On Aug 3, 2008, at 11:02 PM, David Dean wrote:
| 
| > --------
| > Bug report for Octave 3.0.0 configured for i486-pc-linux-gnu
| >
| > Description:
| > -----------
| >
| > As per title. The default call of strtok only considers spaces to
| > deliminate tokens. The deliminator should default to be something like
| > " \t\n" instead of just being " ".
| >
| > Repeat-By:
| > ---------
| >
| >> a ="doc\tb"
| >> [c,d] = strtok(a)
| > c = doc b
| > d =
| >> [c,d] = strtok(a," \t")
| > c = doc
| > d =    b
| 
| 
| Tab (" \t") is added to the default delimiters and an additional test  
| is included.
| 
| Changeset attached.

I think we also need to include LF (\n), VT (\v), FF (\f), and CR (\r).

I made the change in my sources.

Thanks,

jwe


More information about the Bug-octave mailing list