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

 
 

You are not allowed to post comments on this tracker with your current authentication level.

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 - Normal Status:  Fixed
Assigned to:  dolorous Open/Closed:  Closed
* Mandatory Fields

Add a New Comment (Rich Markup)
   

Comment Type & Canned Response:
       

 

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 Member
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 Member
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 Member
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 Files:
   
   
Comment:
   

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by dolorous (Updated the item)
  • -email is unavailable- added by bens (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 logged-in users can vote.

     

     

     

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-11-19 bens Open/ClosedOpen => Closed
    2017-11-13 bens StatusIn Progress => Fixed
    2017-11-12 dolorous Attached File- => Added 0001-files-don-t-change-file-format-when-inserting-into-a.patch, #42378
    2017-11-12 dolorous Attached File- => Added 0001-files-don-t-change-file-format-when-inserting-into-a.patch, #42377
    2017-11-12 bens StatusNone => In Progress
        Assigned toNone => dolorous
    2017-11-12 dolorous Attached File- => Added 0001-files-don-t-change-file-format-when-inserting-into-a.patch, #42376

    Back to the top


    Powered by Savane 3.9