bugGNU Octave - Bugs: bug #33971, strread.m: fixed width format...

 
 

bug #33971: strread.m: fixed width format specifier extending beyond EOLs

Submitted by:  Philip Nienhuis <philipnienhuis>
Submitted on:  Tue 09 Aug 2011 06:56:04 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Philip NienhuisOpen/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 30 Aug 2012 07:20:49 PM UTC, comment #2:

This bug has already been fixed a long time ago in a collection of patches by me that have been reviewed and committed by Rik. Closing this report

Philip Nienhuis <philipnienhuis>
Project Member
Tue 09 Aug 2011 09:08:54 PM UTC, comment #1:

Here's a patch to let the user get away with too wide field width specifiers, cf. ML.
Also user-specified last literals wider than the last one on the lines in a file are allowed (but in the file all these have to be identical)

Difference here is that Octave yields a warning in such a situation if detected in the first "line" of the file or string.

Hunks #1 and #2 take care of that.

Hunk #3 is a bug fix needed now for the following situation (w. only hunks #2 & #3):

(I had this mod (hunk #3) in mind for some time but never hit the situation where it was needed - I now see that was because it was catched by the error stmts higher up that hunks #1 & #2 change into a warning.)

My source tree got mixed up, so no hg changeset but a diff -u, sorry.
Proposed changelog:

2011-08-09 Philip Nienhuis <prnienhuis@users.sf.net>

Allow fixed width format specifiers to extend beyond actual
word width but give suitable warning (bug #33971)
Files: strread.m

(file #23773)

Philip Nienhuis <philipnienhuis>
Project Member
Tue 09 Aug 2011 06:56:04 AM UTC, original submission:

With dev sources strread.m:

I (we) have to think up what to do if a format with specified width (like %2s) extends beyond an EOL delimiter.
This issue is similar to what I described here:

https://mailman.cae.wisc.edu/pipermail/octave-maintainers/2011-August/024406.html

...about Matlab silently accepting fields being less wide than the format specifier width expects.
We know what ML does then, but perhaps we need to inform the user (by warning rather than error) that the format string doesn't exactly match the file, rather than going on silently.

What do you think?

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 #23773:  strread.m.diff_2011aug9#2 added by philipnienhuis (2KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -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 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 30 Aug 2012 07:20:49 PM UTCphilipnienhuisStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Tue 09 Aug 2011 09:08:54 PM UTCphilipnienhuisAttached File-=>Added strread.m.diff_2011aug9#2, #23773

    Back to the top


    Powered by Savane 3.1-cleanup1