bugGNU Octave - Bugs: bug #52310, [octave forge] (io) read_namelist...

 
 

bug #52310: [octave forge] (io) read_namelist cannot read character sequences containing a /

Submitter:  None
Submitted:  Mon 30 Oct 2017 02:53:53 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  philipnienhuis
Originator Name:  Brice DAVIER Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * other
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 04 Nov 2017 09:58:19 AM UTC, comment #3: 

Pushed here with a few minor edits:
http://hg.code.sf.net/p/octave/io/rev/866a7f4544a8

Thanks for the patch!
 
Closing report.

Philip Nienhuis <philipnienhuis>
Group Member
Tue 31 Oct 2017 04:44:27 PM UTC, comment #2: 

You're welcome.
The patch is done on top of the default branch, after 2.4.8 (1069:e568074cf09d). It does not conflict with the previous patch on read_namelist (which was also from me).


Attached is a patch with the style corrections. Also, I just found out that a comment should have been removed in the previous patch, at the beginning of the file:


## -Cannot find end of namelist if marker (/) is preceded by space.


I deleted it in the new patch since it was fixed.

(file #42309)

Anonymous
Mon 30 Oct 2017 06:25:38 PM UTC, comment #1: 

(io pkg maintainer here)
Thanks for the bug report and patch, Brice

Against which io package release have you made the patch?  because recently io-2.4.8 was released and one or two days earlier another patch for read_namelist.m had been applied. That one and your patch shouldn't "cross" :-)

As to your patch: some small style thingies:

  • space between function name and left parenthesis (L. 17, 26, 41, 52, 53, 59, 63, ...)
  • no ";" after an if clause (L. 15)
  • we use ## at start of comment rather than %
  • space between ! and logical expression (L. 42, ...)


I have little experience with Fortran since ~2000 so I  more or less have (to have) blind faith in namelist patches :-)
Maybe someone else can comment on this patch' merits.

Philip Nienhuis <philipnienhuis>
Group Member
Mon 30 Oct 2017 02:53:53 PM UTC, original submission:  

A namelist can contain a / in a character sequence (inside quotes). read_namelist wrongly interprets it as the ending character of the namelist.
The attached patch checks if any / character is quoted. I am not familiar with octave, so there may be simpler ways to do this. It also seems to work well when double quotes and apostrophes contain each other, but my tests were limited.
I hope the changeset is done right !

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #42309:  patch2.txt added by None (3KiB - text/plain - Style corrections)
file #42301:  patch.txt added by None (3KiB - text/plain)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Updated the item)
  • -email is unavailable- added by None (Submitted the item)
  •  

    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 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-07-02 jwe Summary[octave-forge] (io) read_namelist cannot read character sequences containing a / [octave forge] (io) read_namelist cannot read character sequences containing a /
    2017-11-04 philipnienhuis StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2017-10-31 philipnienhuis StatusNone Patch Submitted
        Assigned toNone philipnienhuis
    2017-10-31 jwe Summary[octave-forge] io: read_namelist cannot read character sequences containing a / [octave-forge] (io) read_namelist cannot read character sequences containing a /
    2017-10-31 None Attached File- Added patch2.txt, #42309
    2017-10-30 None Attached File- Added patch.txt, #42301

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code