bugGNU nano - Bugs: bug #52392, inserting a DOS or Mac file will...

 
 

bug #52392: inserting a DOS or Mac file will set that format for the current file too

Submitted by:  Benno Schulenberg <bens>
Submitted on:  Sat 11 Nov 2017 10:56:05 AM UTC  
 
Severity: 3 - NormalStatus: Fixed
Assigned to: David Lawrence Ramsey <dolorous>Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Mon 13 Nov 2017 07:06:44 PM UTC, comment #5:

Thanks. Fixed in git, 169da094.

Benno Schulenberg <bens>
Project Administrator
Sun 12 Nov 2017 09:25:27 PM UTC, comment #4:

Attached a third version that builds properly with --enable-tiny; I forgot the second set of #ifdefs in the last version.

(file #42378)

David Lawrence Ramsey <dolorous>
Project AdministratorIn charge of this item.
Sun 12 Nov 2017 07:37:36 PM UTC, comment #3:

Thanks for the feedback. Attached a second version that uses ISSET(MULTIBUFFER) and does so in do_insertfile() (and doesn't drop the Mac format from the es.gmo file).

(file #42377)

David Lawrence Ramsey <dolorous>
Project AdministratorIn charge of this item.
Sun 12 Nov 2017 06:55:39 PM UTC, comment #2:

Thanks for the patch. But when running src/nano --ignore --multi, and then typing ^R po/es.gmo <Enter>, it drops the Mac format from the es.gmo file. I think it should '!ISSET(MULTIBUFFER)' instead of 'undoable'. And I would have expected this logic in do_insertfile(), but that as an aside.

Benno Schulenberg <bens>
Project Administrator
Sun 12 Nov 2017 06:09:55 PM UTC, comment #1:

The attached patch against git 1e29214 should fix this. (The logic could most likely be consolidated more, but it does work.)

(file #42376)

David Lawrence Ramsey <dolorous>
Project AdministratorIn charge of this item.
Sat 11 Nov 2017 10:56:05 AM UTC, original submission:

To reproduce, run:

src/nano --ignore +44 NEWS

Then type: ^R po/es.gmo <Enter>.
It will say something like:

Read 326 lines (Converted from Mac format)

Now type ^O. See that it wants to save the NEWS file (which was in Unix format) in Mac format. This is unexpected, and unwanted.

But worse: nowadays I just do ^S ^X and hardly use ^O any more, so only when reopening the file later will I realize that its format has changed. Not good.

Of course I could use "set unix" in my .nanorc file, but that would change DOS files and Mac files into Unix files too.

No. When a file is in Unix format, inserting any other file should not change that format.

Benno Schulenberg <bens>
Project Administrator

 

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

Attach File(s):
   
   
Comment:
   

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by dolorous (Updated the item)
  • -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 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 19 Nov 2017 08:27:55 AM UTCbensOpen/ClosedOpen=>Closed
    Mon 13 Nov 2017 07:06:44 PM UTCbensStatusIn Progress=>Fixed
    Sun 12 Nov 2017 09:25:27 PM UTCdolorousAttached File-=>Added 0001-files-don-t-change-file-format-when-inserting-into-a.patch, #42378
    Sun 12 Nov 2017 07:37:36 PM UTCdolorousAttached File-=>Added 0001-files-don-t-change-file-format-when-inserting-into-a.patch, #42377
    Sun 12 Nov 2017 06:55:39 PM UTCbensStatusNone=>In Progress
      Assigned toNone=>dolorous
    Sun 12 Nov 2017 06:09:55 PM UTCdolorousAttached File-=>Added 0001-files-don-t-change-file-format-when-inserting-into-a.patch, #42376

    Back to the top


    Powered by Savane 3.1-cleanup1