Menu

#4069 Reports every file opened as a likely backup file

minor bug
closed-fixed
None
5
2018-07-17
2018-07-17
Farmer Dave
No
jEdit 5.5.0 reports The file {0} is likely a jEdit backup file.” for every file I attempt to open!
The problem appears to be that if the backup prefixes and suffixes are empty, they match every file! When I change the backup prefix to # and the suffix to ~, the old defaults, the problem goes away.

The problem resides in /home/public/jedit-5.5.0/jEdit/org/gjt/sp/jedit/MiscUtilities.java, line 1023, isBackup(). When using startsWith() and endsWith() with empty strings, they always match! I suggest adding a test for isEmpty().

There appears to be a second bug in the same method on line 1049. The code calls startsWith(backupSuffix), when it should probably call endsWith(backupSuffix).

Discussion

  • Dale Anson

    Dale Anson - 2018-07-17
    • assigned_to: Dale Anson
     
  • Dale Anson

    Dale Anson - 2018-07-17

    Well, I see my fingerprints all over this section of code, I'll get it straightened out.

     
  • Dale Anson

    Dale Anson - 2018-07-17
     
  • Dale Anson

    Dale Anson - 2018-07-17

    Fixed in revision 24872.

     
  • Dale Anson

    Dale Anson - 2018-07-17
    • status: open --> closed-fixed
     

Log in to post a comment.