bugGNU Octave - Bugs: bug #46477, textscan.m / textread.m endofline...

 
 

bug #46477: textscan.m / textread.m endofline parameter fails with single quotes

Submitter:  None
Submitted:  Thu 19 Nov 2015 03:58:02 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  philipnienhuis
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 4.0.0
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 20 Nov 2015 02:09:48 PM UTC, comment #4: 

You can get the updated files here:
http://hg.savannah.gnu.org/hgweb/octave/file/ab0d9d7f479c/scripts/io/textread.m
and
http://hg.savannah.gnu.org/hgweb/octave/file/ab0d9d7f479c/scripts/io/textscan.m

Where to put them?
in an Octave prompt, do:
which textscan

Indeed the fix was to make Octave interpret the "sq-string" value (Single Quoted strings) as a double-quoted one. The vast majority of all other string parameter values are treated similarly in strread.m (textscan's/textread's work horse) but this one had been overlooked.

Philip Nienhuis <philipnienhuis>
Group Member
Fri 20 Nov 2015 11:34:31 AM UTC, comment #3: 

I should have said that this happens with any single-quoted end-of-line character; but any fix will presumably fix all.

Thanks for fixing.

Anonymous
Fri 20 Nov 2015 10:42:24 AM UTC, comment #2: 

Fixed on stable branch with this cs:
http://hg.savannah.gnu.org/hgweb/octave/rev/ab0d9d7f479c

Title adapted;
Item group adapted (this was a plain bug, not just ML compatibility).

Closing report

Philip Nienhuis <philipnienhuis>
Group Member
Thu 19 Nov 2015 10:46:25 PM UTC, comment #1: 

Confirmed.
Is an easy fix, also required for textread.m

Thx for reporting.

Philip Nienhuis <philipnienhuis>
Group Member
Thu 19 Nov 2015 03:58:02 PM UTC, original submission:  


textscan('hello, world; apologies for the inconvenience', '%s%s', 'endofline',"\n");
textscan('hello, world; apologies for the inconvenience', '%s%s', 'endofline','\n');


The first line works; the second, using single quotes for the end-of-line character, fails with an error:


error: textscan: illegal EndOfLine character value specified
error: called from
    textscan at line [y] column [x]


Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only group members can vote.

 

Follow 7 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2015-11-20 philipnienhuis Item GroupMatlab Compatibility Incorrect Result
    StatusConfirmed Fixed
    Open/ClosedOpen Closed
    Summarytextscan endofline fails with single quotes textscan.m / textread.m endofline parameter fails with single quotes
2015-11-19 philipnienhuis StatusNone Confirmed
    Assigned toNone philipnienhuis
    Operating SystemGNU/Linux Any

Back to the top

Powered by Savane 3.13-d3ae.
Corresponding source code