bugGNU Octave - Bugs: bug #42609, strread.m doesn't properly process...

 
 

bug #42609: strread.m doesn't properly process delimiter literals

Submitted by:  Philip Nienhuis <philipnienhuis>
Submitted on:  Tue 24 Jun 2014 08:31:25 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 26 Jun 2014 06:47:52 PM UTC, comment #3:

I think do_string_escape is a good idea in any case.

BTW thanks for pushing my patch.
Although I'm not certain it'll cover all cases, would it be OK to close this bug report?

Philip Nienhuis <philipnienhuis>
Project Member
Wed 25 Jun 2014 09:20:27 PM UTC, comment #2:

Thanks for the patch. It seems to work if the format is a double quoted string, in which case Octave converts the backslash string escapes to single characters when it parses the double quoted string. But if the format is a single quoted string, it fails for me:

My understanding is that this works in Matlab. Is there any reason that we shouldn't alway do

+verabtim+
if (strcmp (typeinfo (fmt), 'sq_string'))
fmt = do_string_escapes (fmt);
endif
-verbatim-

at the beginning of strread?

I made that change here:

http://hg.savannah.gnu.org/hgweb/octave/rev/c32f378e08f3

Let me know if there is some reason to not make this change.

Thanks.

John W. Eaton <jwe>
Project Administrator
Tue 24 Jun 2014 08:42:01 PM UTC, comment #1:

Here's a changeset cf. option 2. in my first post in the relevant maintainers ML thread.

Seems to work OK, all tests (incl. 2 new ones) pass; yet I think there should be more investigation into what Matlab exactly does. I have no time for that now

(file #31613)

Philip Nienhuis <philipnienhuis>
Project Member
Tue 24 Jun 2014 08:31:25 PM UTC, original submission:

See this discussion on maintainers ML:
http://octave.1599824.n4.nabble.com/newline-in-strread-format-td4664978.html

[a, b, c] = strread ("1 2 3n4 5 6n7 8 9n", "%f %f %fn")

errors out with "strread: FORMAT does not match data"

I'll come up with a first quick patch soon

Philip Nienhuis <philipnienhuis>
Project Member

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #31613:  strread_bug#42609.cs added by philipnienhuis (1KiB - text/x-csharp)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Updated the item)
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by philipnienhuis (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 03 Aug 2014 05:57:51 AM UTCrik5StatusPatch Submitted=>Fixed
      Open/ClosedOpen=>Closed
    Tue 24 Jun 2014 08:42:01 PM UTCphilipnienhuisAttached File-=>Added strread_bug#42609.cs, #31613
      StatusConfirmed=>Patch Submitted

    Back to the top


    Powered by Savane 3.1-cleanup1