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

 
 

bug #41281: LF/CR problem causes incomplete execution

Submitted by:  None
Submitted on:  Sun 19 Jan 2014 04:14:11 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Originator Email: -unavailable-
Open/Closed: ClosedRelease: 3.8.0
Operating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

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>
Project 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 <ttl>
Project Member
Mon 20 Jan 2014 03:35:14 AM UTC, comment #2:

this seems relevant:
<http://www.scintilla.org/ScintillaDoc.html#SCI_SETEOLMODE>

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
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 File(s):
   
   
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
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by ttl (Posted a comment)
  • -unavailable- added by fgnievinski (Posted a comment)
  •  

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

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 20 Jan 2014 06:45:18 AM UTCjweOpen/ClosedOpen=>Closed
    Mon 20 Jan 2014 06:44:58 AM UTCjweCategoryOctave 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
    Sun 19 Jan 2014 10:16:46 PM UTCNoneAttached File-=>Added myFun1.m, #30313
      Attached File-=>Added myFun2.m, #30314

    Back to the top


    Powered by Savane 3.1-cleanup1