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

Submitted by:  Benno Schulenberg <bens>
Submitted on:  Fri 14 May 2021 07:49:40 AM UTC  
 
Severity:  2 - Minor Status:  Fixed
Assigned to:  Benno Schulenberg <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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.

 

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)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

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