bugGNU nano - Bugs: bug #56488, the status bar reports the wrong...

 
 

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

bug #56488: the status bar reports the wrong file when there is a bad included file

Submitter:  Benno Schulenberg <bens>
Submitted:  Thu 13 Jun 2019 11:45:33 AM UTC
   
 
Severity:  2 - Minor Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Jump to the original submission

Sun 18 Aug 2019 09:11:23 AM UTC, comment #9: 

s/; and/; an/

Benno Schulenberg <bens>
Group administrator
Sun 18 Aug 2019 09:01:55 AM UTC, comment #8: 

Ah, okay.  But the check is better placed in parse_includes(); and empty syntax at the end of an include file is already caught.

This extra little bug is fixed in git, commit 073bd3ad.

Benno Schulenberg <bens>
Group administrator
Sat 17 Aug 2019 05:51:45 PM UTC, comment #7: 

Oops, I transposed the lines, it should be:

syntax empty "empty"
include ".../*.nanorc"


Brand Huntsman <brand>
Sat 17 Aug 2019 11:57:28 AM UTC, comment #6: 

Thanks for the updated patch.  After improving the commit message, pushed to master, commit 82f5fed4.

But... as far as I can tell, the second patch is not needed: I do not see the erroneous error message that you are reporting in comment #5.

The third patch is indeed a welcome improvement.  Pushed to master in commit 304f072 (with a modified commit message).

Benno Schulenberg <bens>
Group administrator
Wed 14 Aug 2019 09:41:35 PM UTC, comment #5: 

Saving and restoring nanorc and lineno in parse_one_include() works and replaces the first patch. The second and third patches are still needed.

include ".../*.nanorc"
syntax empty "empty"

Error in .../lastfile.nanorc on line N: Syntax "empty" has no color commands

The second patch fixes that.

Empty syntaxes are reported at the line of the next command or bottom of file. Opening the default /etc/nanorc and adding an empty syntax reports the error hundreds of lines away at bottom of file. The third patch fixes this.

(file #47346)

Brand Huntsman <brand>
Wed 14 Aug 2019 11:41:25 AM UTC, comment #4: 

Thanks for the patches.  But using the reproduction recipe, it now says on the status bar: "[ Mistakes in '/home/ben/Sources/NANO/syntax/folder.nanorc' ]".  But... there aren't actually any mistakes in folder.nanorc, the mistake is in the include statement that includes this folder.nanorc.

So, what I would like to see on the status bar is: "[ Mistakes in /home/ben/.nanorc ]".  And when exiting from nano, there should be these messages on the terminal:

Error in /home/ben/.nanorc on line 57: "/home/ben/Sources/NANO/syntax/folder.nanorc" is a directory
Error in /home/ben/.nanorc on line 57: "/home/ben/Sources/NANO/syntax/random.nanorc" is a device file

Benno Schulenberg <bens>
Group administrator
Tue 09 Jul 2019 03:02:10 AM UTC, comment #3: 

The empty syntax check also needs to be performed before changing nanorc to an include file. Second patch.

And the empty syntax check should use the lineno of the syntax instead of the location the check is performed. Third patch.

(file #47173, file #47174)

Brand Huntsman <brand>
Mon 08 Jul 2019 07:23:36 PM UTC, comment #2: 

(I'm away on vacation.  Will get to this and the other things in about three weeks.)

Benno Schulenberg <bens>
Group administrator
Sat 29 Jun 2019 11:10:10 AM UTC, comment #1: 

is_good_file() calls jot_error() which sets rcfile_with_errors to the current string in the nanorc global. Problem is that parse_one_include() calls is_good_file() before it updates the nanorc global.

(file #47144)

Brand Huntsman <brand>
Thu 13 Jun 2019 11:45:33 AM UTC, original submission:  

To reproduce, have in your ~/.nanorc file an include statement with a globbing pattern: include /some/directory/*.nanorc.  Then create in that directory:

  mkdir folder.nanorc
  ln -s /dev/random random.nanorc

Then run nano.  On the status bar it will report that there are errors in elisp.nanorc.  Now remove folder.nanorc and run nano again.  It will now report that there are errors in python.nanorc.

Of course, when exiting from nano, the correct messages get printed to the terminal.  But the initial message on the status bar is wrong and misleading.  It should print either the correct name, or no name at all.

Bug exists since at least nano-2.9.1.  (Before that is harder to check because the syntax names needed quotes then.)

Benno Schulenberg <bens>
Group administrator

 

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

 

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.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-08-26 bens Open/ClosedOpen Closed
    2019-08-17 bens StatusNone Fixed
        Assigned toNone bens
    2019-08-14 brand Attached File- Added 0001-restore-nanorc-and-lineno-after-parsing-an-include-file.patch, #47346
    2019-07-09 brand Attached File- Added 0002-rcfile-check-for-empty-syntax-before-parsing-an-include-file.patch, #47173
        Attached File- Added 0003-rcfile-show-lineno-for-syntax-instead-of-where-the-empty-syntax-check-is-performed.patch, #47174
    2019-06-29 brand Attached File- Added set-nanorc-before-calling-is_good_file.patch, #47144

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code