SF.net SVN: geany: [1532] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Mon May 14 15:53:23 UTC 2007


Revision: 1532
          http://svn.sourceforge.net/geany/?rev=1532&view=rev
Author:   ntrel
Date:     2007-05-14 08:53:23 -0700 (Mon, 14 May 2007)

Log Message:
-----------
Hopefully fix #1718532 - 'Crashes when open a special file';
backported from Scintilla 1.73.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/scintilla/LexHTML.cxx

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2007-05-14 13:06:18 UTC (rev 1531)
+++ trunk/ChangeLog	2007-05-14 15:53:23 UTC (rev 1532)
@@ -5,6 +5,9 @@
    Reorder Haskell, O-Matrix, VHDL filetypes.
  * src/document.c:
    Fix removing indent spaces after switching back to tab indenting.
+ * scintilla/LexHTML.cxx:
+   Hopefully fix #1718532 - 'Crashes when open a special file';
+   backported from Scintilla 1.73.
 
 
 2007-05-12  Nick Treleaven  <nick.treleaven at btinternet.com>

Modified: trunk/scintilla/LexHTML.cxx
===================================================================
--- trunk/scintilla/LexHTML.cxx	2007-05-14 13:06:18 UTC (rev 1531)
+++ trunk/scintilla/LexHTML.cxx	2007-05-14 15:53:23 UTC (rev 1532)
@@ -863,7 +863,9 @@
 				styler.ColourTo(i - 1, StateToPrint);
 				state = SCE_H_SGML_SIMPLESTRING;
 			} else if ((ch == '-') && (chPrev == '-')) {
-				styler.ColourTo(i - 2, StateToPrint);
+				if (static_cast<int>(styler.GetStartSegment()) <= (i - 2)) {
+					styler.ColourTo(i - 2, StateToPrint);
+				}
 				state = SCE_H_SGML_COMMENT;
 			} else if (isascii(ch) && isalpha(ch) && (chPrev == '%')) {
 				styler.ColourTo(i - 2, StateToPrint);
@@ -1600,8 +1602,9 @@
 				styler.ColourTo(i - 1, StateToPrint);
 				state = SCE_HPHP_HSTRING_VARIABLE;
 			} else if (styler.Match(i, phpStringDelimiter)) {
-				if (strlen(phpStringDelimiter) > 1)
-					i += strlen(phpStringDelimiter) - 1;
+				const int psdLength = strlen(phpStringDelimiter);
+				if ((psdLength > 1) && ((i + psdLength) < lengthDoc))
+					i += psdLength - 1;
 				styler.ColourTo(i, StateToPrint);
 				state = SCE_HPHP_DEFAULT;
 			}


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list