bugGNU nano - Bugs: bug #60605, file size is wrong after automatic...

 
 

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

bug #60605: file size is wrong after automatic hardwrapping of quoted text

Submitter:  Benno Schulenberg <bens>
Submitted:  Fri 14 May 2021 07:49:40 AM UTC
   
 
Severity:  2 - Minor Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Fri 14 May 2021 08:27:27 AM UTC, comment #1: 

Fixed in git, commit 51adf02d, by adding the number of bytes in the quoting part to the file size.  As the commit message says, this is not fully correct -- it should add mbstrlen(quoting part) instead -- but it will do for now.

Benno Schulenberg <bens>
Group administrator
Fri 14 May 2021 07:49:40 AM UTC, original submission:  

To reproduce, run:

src/nano --ignore --auto --break --fill=42  +6 README

Type M-D.  See that there are 2951 characters.
Now type: <Space> M-D.  See that there are now 2957 characters.  This is correct: one space, one newline, and four extra indentation spaces were added, six characters in total.
Type: M-U M-D.  See that we're back at 2951 characters.
Now type: # M-D.  Oww.  Nano thinks that there are 2953 characters now, which is wrong.  A hash, a newline, another hash, and four extra spaces were added, seven characters in total.  The count should therefore be 2958 characters.

The problem is that when copying the quoting from the current line to the next, the total size of the file is not adjusted for this.  (When there is quoting, autoindentation is temporarily switched off, so that it does not interfere, which means its size adjustment doesn't happen either.)

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

    Date Changed by Updated Field Previous Value => Replaced by
    2021-06-16 bens Open/ClosedOpen Closed
    2021-05-14 bens StatusNone Fixed

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code