Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#454 BugFix ##4191: Crash when uncomment SQL block

Next_release
closed
nobody
None
7
2013-04-01
2013-02-12
FLS
No

Bug:
Npp crashes with an exception when uncommenting a block-comment where the block comment string is not defined with "commentLine"-entry in langs.xml.
This bug was reported for SQL-files in bugreport #4191.

Note: Apparently, for SQL files Scintilla highlightes the "--" string as comment, even when not defined in langs.xml!!??

BugFix:
Coding error in function doBlockComment() corrected and SQL "commentLine"-entry added in langs.model.xml.
Patch NppPatch_6.3_UncommentSQLBugFix.patch is based on Npp 6.3 (SVN 1019)
FLS

1 Attachments

Discussion

  • Don HO
    Don HO
    2013-02-17

    Thank you for the patch.

    The bug fix contains only
    - undoStreamComment();
    + return undoStreamComment();

    Could you confirm it?

    Don

     
    • FLS
      FLS
      2013-02-20

      Yes, that was the main bug fix of that crash, because without "return"
      in front of undoStreamComment();, the rest of the subroutine is
      executed and crashes at the opereation:

      generic_string comment(commentLineSybol);

      because commentLineSymbol is a NULL-pointer if commentLine-entry is missing in the langs.xml

      To be on the save side in case of other modifications, I have additionally added an else-clause around the rest of the subroutine until

      } // else of "no commentLineSybol" available.

      The rest of the patch is indention and deletion of some uncommented code.

      FLS

       
  • Don HO
    Don HO
    2013-02-18

    • status: open --> accepted
     
  • Don HO
    Don HO
    2013-04-01

    • status: accepted --> closed