bugGNU nano - Bugs: bug #56524, when unable to read history files,...


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

bug #56524: when unable to read history files, nano should not pause

Submitter:  Benno Schulenberg <bens>
Submitted:  Thu 20 Jun 2019 09:28:06 AM UTC
Severity:  2 - Minor Status:  Fixed
Assigned to:  bens Open/Closed:  Closed
* Mandatory Fields

Add a New Comment (Rich Markup)

Comment Type & Canned Response:


Sun 20 Oct 2019 12:41:57 PM UTC, comment #2: 

Sorry for leaving this unaddressed for so long.  But I didn't like the somewhat incorrect error message that your patch produces when (for example) the file-position file is unreadable:

  [ Mistakes in '/home/ben/.nano/filepos_history' ]

There are no mistakes in the file itself, it's a problem _about the file.

So I've implemented a different solution, one that renames and changes the meaning of a variable.  Commit 95ae1248.

Benno Schulenberg <bens>
Project Administrator
Tue 20 Aug 2019 12:49:18 AM UTC, comment #1: 

I don't know what happened to my comment for this one. But jot_error needs nanorc to be set. Exporting the nanorc variable and having code outside rcfile.c set it would be confusing. The patch adds a set_error_file function which is clearer than setting a variable called 'nanorc'.

But it might better to create a second jot_error function that takes a file parameter, sets nanorc, and then calls jot_error. That way jot_error is never called outside rcfile.c without first calling set_error_file.

I didn't have set_error_file set lineno to zero, but it should. Otherwise it would prepend the filename and some bogus line number to the error message.

Brand Huntsman <brand>
Thu 20 Jun 2019 09:28:06 AM UTC, original submission:  

To reproduce, make nano's filepos_history or search_history file unreadable (chmod u-r ...).  Then start nano.  See that it reports an error and asks to press Enter to continue.

Expected behavior: nano should just start, report an error on the status bar, and, upon exit from nano, the original error message should be on the terminal.

So... make src/history.c use jot_error() to save any error messages and spit them out upon exit.

Benno Schulenberg <bens>
Project Administrator


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

Attach Files:


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by brand (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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-11-30 bens Open/ClosedOpen Closed
    2019-10-20 bens StatusNone Fixed
        Assigned toNone bens
    2019-06-29 brand Attached File- Added log-history-files-errors-to-console-and-display-stat.patch, #47145

    Back to the top

    Powered by Savane 3.9