bugGNU Octave - Bugs: bug #57469, F9 with escape sequences...

 
 

bug #57469: F9 with escape sequences ("\n", "\t", etc.) leads to unexpected results

Submitter:  Markus Mützel <mmuetzel>
Submitted:  Mon 23 Dec 2019 10:31:53 AM UTC
   
 
Category:  GUI Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 05 Jan 2020 07:19:08 PM UTC, comment #3: 
Torsten Lilge <ttl>
Group Member
Mon 23 Dec 2019 04:29:24 PM UTC, comment #2: 

It is not just newlines, it seems to be any one of the special escape sequences.  I tried "\t" for tab and the output is printed and then immediately deleted.

Test string


printf ("  %-30s %6d\tafter_tab", "PASS", 8);


On the other hand, if I copy and paste this text in to the Command Window and hit enter it runs correctly.  So, if there is a way to have F9 pass the results more directly to the interpreter that might help.

Also, I can get rid of the newline on the command window by double escaping it in the Editor like so


printf ("  %-30s %6d\\njunk", "PASS", 8);


But this still doesn't print the results of executing the statement.

Rik <rik5>
Group administrator
Mon 23 Dec 2019 11:49:37 AM UTC, comment #1: 

It doesn't matter if the string is single or double quoted.
Changing summary accordingly.

Markus Mützel <mmuetzel>
Group administrator
Mon 23 Dec 2019 10:31:53 AM UTC, original submission:  

Marking the following string in the editor and hitting F9 leads to an unexpected result:

      printf ("  %-30s %6d\n", "PASS", 8);


The result in the command window is:

>>       printf ("  %-30s %6d
", "PASS", dp);
  %-30s %6d


The expected result is:

>>       printf ("  %-30s %6d\n", "PASS", dp);
  PASS                                8


Markus Mützel <mmuetzel>
Group administrator

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by ttl (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by mmuetzel (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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-01-05 ttl StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2019-12-23 rik5 StatusNone Confirmed
        SummaryF9 with new line in strings leads to unexpected result F9 with escape sequences ("\n", "\t", etc.) leads to unexpected results
    2019-12-23 mmuetzel SummaryF9 with double quoted strings leads to unexpected result F9 with new line in strings leads to unexpected result

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code