bugGNU nano - Bugs: bug #47716, a lone final \r of a Mac file is...

 
 

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

bug #47716: a lone final \r of a Mac file is not read in

Submitter:  Benno Schulenberg <bens>
Submitted:  Sat 16 Apr 2016 02:44:49 PM UTC
   
 
Severity:  3 - Normal Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Sun 17 Apr 2016 11:28:15 AM UTC, comment #1: 

Fixed in git, 086b852.

Benno Schulenberg <bens>
Group administrator
Sat 16 Apr 2016 02:44:49 PM UTC, original submission:  

To reproduce, run 'src/nano --ignore --nonewline +8 somefile', where somefile is a new file.  Type: 1 <Enter> 2 <Enter> <Enter> <Enter> <Enter>.  Then type ^O <Enter> and notice that it said "Wrote 5 lines".  Now exit and run the same command again.  Notice that it says "Read 5 lines".  Good.  Now type ^O M-M <Enter>.  It says it wrote 5 lines.  Exit and run the same command again.  It says it read 5 lines, but notice that the cursor is now a line further up.  Now repeat: ^O <Enter> ^X, and rerun the same command.  Notice how every time a line less is written, and the cursor creeps up until it sits on the 2.  And there it stays.  The file now has just two lines.

There is a piece of code that seems intended to handle such a lone \r (in src/files.c where it says "as a Mac format line"), but it never triggers.  I don't get it.  The fragment after it triggers, but somehow this does not result in an extra line.

When you do the same procedure (save, exit, reopen) with a DOS of Unix file, it stays five lines -- as one would expect.

Benno Schulenberg <bens>
Group administrator

 

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

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 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.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-06-20 bens Open/ClosedOpen Closed
    2016-04-17 bens StatusIn Progress Fixed
        Summarya lone final \\r of a Mac file is not read in a lone final \r of a Mac file is not read in
    2016-04-16 bens StatusNone In Progress
        Assigned toNone bens
        Summarya lone final \\r of a Mac file is not read in a lone final \r of a Mac file is not read in

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code