bugGNU nano - Bugs: bug #49868, file browser cannot open a file...

 
 

bug #49868: file browser cannot open a file with a name containing a newline

Submitted by:  Benno Schulenberg <bens>
Submitted on:  Fri 16 Dec 2016 06:44:10 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:34:19 AM UTC, comment #2:

Fixed in git, 0b0b8122.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Sat 17 Dec 2016 03:58:38 PM UTC, comment #1:

Comparison with other editors.

Running 'pico abc*def' opens the file without problem, and show the name in the titlebar as "abc^Jdef", which is better than nano, but it adds a stray $ at the tail of the bar, as if it thinks that the contained text is longer than the bar. Opening the file browser witj ^R ^T show the name "abc.def" spread over two lines, which is /worse/ than nano. But still, selecting the file opens it fine, which is what nano can't do at the moment.

Runing 'vim abcdef' shows the name of the file as "abc^@def" in the statusbar, which seems good. But running 'vim .', it shows the file as two lines in in the browser: "abc" and "def" -- trying to select either, it opens a new file instead of opening the existing abcdef.

Running 'emacs -nw abc*def' opens the file fine, and shows the name as "abc^Jdef" on the statusbar. Running 'emacs -nw .' lists the name of the file spread over two lines -- trying to select it selects in fact "abc" and says that the file no longer exists.

So... I think nano should show the filename as "abc^Jdef", since the name contains a ^J, not a ^@. And if the file browser will be able to select the file (like pico is), we will have gained something over the other two. :)

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

To reproduce, echo characters >"abc
def". Then run nano, type ^R ^T, move the highlight to "abc^@def" and press <Enter>. The statubar says «File ".../abc" not found». Apparently the filename gets truncated at the embedded newline.

Expected behavior: the file should be opened normally, just like when it was specified on the command line.

Now exit from nano, and rund 'nano --ignore abc*'. The file gets opened fine -- but the name in the titlebar gets spread over two lines.

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

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 30 Dec 2016 10:27:36 AM UTCbensOpen/ClosedOpen=>Closed
    Sun 18 Dec 2016 11:34:19 AM UTCbensStatusNone=>Fixed
    Sat 17 Dec 2016 03:58:38 PM UTCbensAssigned toNone=>bens
      Summaryfile browser cannot open a file with a name that contains a newline=>file browser cannot open a file with a name containing a newline

    Back to the top


    Powered by Savane 3.1-cleanup1