bugGNU Octave - Bugs: bug #41281, LF/CR problem causes incomplete...

 
 

bug #41281: LF/CR problem causes incomplete execution

Submitter:  None
Submitted:  Sun 19 Jan 2014 04:14:11 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.8.0
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 20 Jan 2014 06:44:58 AM UTC, comment #4: 

Octave is supposed to be pretty liberal about accepting LF, CR, or CRLF.

I checked in the following changeset:

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

This change will be part of the upcoming 3.8.1 release.

John W. Eaton <jwe>
Group administrator
Mon 20 Jan 2014 05:46:51 AM UTC, comment #3: 

Which eol mode does octave core accept? Obviously only LF and CR/LF or does it accept CR on Mac?

Since the execution of a file in CR-mode from the cli fails, too, I am wondering if this should be handled by the gui or by the core.

Torsten Lilge <ttl>
Group Member
Mon 20 Jan 2014 03:35:14 AM UTC, comment #2: 
Felipe G. Nievinski <fgnievinski>
Sun 19 Jan 2014 10:16:46 PM UTC, comment #1: 

What I wanted to say, there is discrepancy between what the editor in the GUI shows (i.e. two lines) and what the interpreter sees (i.e. one sinlge line).
I attached demo files (myFun1.m myFun2.m)

(file #30313, file #30314)

Anonymous
Sun 19 Jan 2014 04:14:11 PM UTC, original submission:  

At first I was deeply confused that Octave seemingly did not execute disp('Hi!'). After copy&pasting the code to a fresh file inside the GUI the problem was gone. After more trial&error, I found that a difference in newline/carriage return encoding was the culprit.
If you have code like this

%
disp('Hi');

and there is only a 0x0D character after the %-character, the interpreter will not recognize the new line the disp-call is treated as comment.
If you have a 0x0D 0x0A in your text file, than everything works as expected.
You can argue if this an octave core bug, a GUI display problem, or a platform encoding problem, but regardless of that, please fix it!

I use  http://octave.osuv.de/3.8/windows/octave-3.8.0-1-installer.exe

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #30313:  myFun1.m added by None (29B - application/octet-stream - myFun1 with Mac-Style CR newline, myFun2 with CR-LF)
file #30314:  myFun2.m added by None (30B - application/octet-stream - myFun1 with Mac-Style CR newline, myFun2 with CR-LF)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by ttl (Posted a comment)
  • -email is unavailable- added by fgnievinski (Posted a comment)
  •  

    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
    2014-01-20 jwe Open/ClosedOpen Closed
    2014-01-20 jwe CategoryOctave Function Interpreter
        Item GroupInaccurate Result Incorrect Result
        StatusNone Fixed
        Operating SystemMicrosoft Windows Any
        SummarySerious LF/CR problem causes incomplete execution LF/CR problem causes incomplete execution
    2014-01-19 None Attached File- Added myFun1.m, #30313
        Attached File- Added myFun2.m, #30314

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code