bugGNU nano - Bugs: bug #49867, a filename or dirname with an...

 
 

bug #49867: a filename or dirname with an embedded newline messes up the title bar

Submitted by:  Benno Schulenberg <bens>
Submitted on:  Fri 16 Dec 2016 06:33:02 PM UTC  
 
Severity: 3 - NormalStatus: Fixed
Assigned to: Benno Schulenberg <bens>Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Sun 18 Dec 2016 11:33:41 AM UTC, comment #3:

Fixed in git, dfff78df. And the ^@ -> ^J part in eafae5d4.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Sat 17 Dec 2016 07:56:37 PM UTC, comment #2:

It has happened in commit 577f7faf, the rewrite of the titlebar code. It now does 'waddstr(topwin, path)' instead of passing path through display_string() first.

However... In file data, a 0x0a means an encoded null (0x00), so 0x0a should be represented as ^@. But in file names, a 0x0a simply means a ^J, an embedded newline -- file names cannot contain 0x00. Also in any other data displayed on the statusbar or at the prompt and embedded 0x0a could be shown as a ^J because it is /impossible/ that such data even contains 0x0a (it is not possible to enter ^J at the prompt: it will be understood as a press of <Enter>) nor 0x00 (any null byte would have meant end of string).

So... with a little tweak to the calls of display_string(), it will be possible to interpret the parameter 'dollars' not just as an indication of a leading or trailing $, but also as a flag whether to represent a 0x0a as ^@ (TRUE) or as ^J (FALSE).

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Sat 17 Dec 2016 05:13:36 PM UTC, comment #1:

Bug exists since nano-2.6.0. Somewhere a 'display_string()' was dropped.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Fri 16 Dec 2016 06:33:02 PM UTC, original submission:

To reproduce, create a directory with a newline in it (for example: mkdir "123
456"). Then run nano, type ^R ^T, move the highlight to 123^@456 and press <Enter>. Woah! The titlebar gets cut short after "123", and the "456/" appears on the second line of the screen. The latter string will stay there the rest of the session -- unless you toggle morespace with M-O. Not good.

Expected behavior: a dirname with a newline should be represented in the titlebar in the same way as in the browser.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bens (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 logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 30 Dec 2016 10:27:23 AM UTCbensOpen/ClosedOpen=>Closed
    Sun 18 Dec 2016 11:33:41 AM UTCbensStatusIn Progress=>Fixed
    Sat 17 Dec 2016 07:56:37 PM UTCbensStatusNone=>In Progress
    Sat 17 Dec 2016 04:06:12 PM UTCbensAssigned toNone=>bens
      Summarya dirname with a newline messes up the title bar=>a filename or dirname with an embedded newline messes up the title bar

    Back to the top


    Powered by Savane 3.1-cleanup1