openbsd-ports/editors/scintilla/patches/patch-src_LexHTML_cxx
sturm a8ed68f4f2 Initial import of scintilla 1.54
Scintilla is a free source code editing component. As well as features
found in standard text editing components, Scintilla includes features
especially useful when editing and debugging source code. These include
support for syntax styling, error indicators, code completion and call
tips. The selection margin can contain markers like those used in debuggers
to indicate breakpoints and the current line. Styling choices are more open
than with many editors, allowing the use of proportional fonts, bold and
italics, multiple foreground and background colours and multiple fonts.

WWW: http://www.scintilla.org/

from Joerg Sonnenberger <joerg@bec.de> with patches from Andrew Dalgleisch
2003-08-14 18:24:30 +00:00

40 lines
1.9 KiB
Plaintext

$OpenBSD: patch-src_LexHTML_cxx,v 1.1.1.1 2003/08/14 18:24:31 sturm Exp $
--- src/LexHTML.cxx.orig 2003-08-14 01:19:02.000000000 +1000
+++ src/LexHTML.cxx 2003-08-14 01:21:26.000000000 +1000
@@ -287,7 +287,7 @@ static int classifyWordHTVB(unsigned int
return SCE_HB_DEFAULT;
}
-static void classifyWordHTPy(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler, char *prevWord, script_mode inScriptType) {
+static void classifyWordHTPy(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler, char *prevWord, size_t prevWord_len, script_mode inScriptType) {
bool wordIsNumber = IsADigit(styler[start]);
char s[30 + 1];
unsigned int i = 0;
@@ -305,7 +305,7 @@ static void classifyWordHTPy(unsigned in
else if (keywords.InList(s))
chAttr = SCE_HP_WORD;
styler.ColourTo(end, statePrintForState(chAttr, inScriptType));
- strcpy(prevWord, s);
+ strlcpy(prevWord, s, prevWord_len);
}
// Update the word colour to default or keyword
@@ -724,7 +724,7 @@ static void ColouriseHyperTextDoc(unsign
classifyWordHTVB(styler.GetStartSegment(), i - 1, keywords3, styler, inScriptType);
break;
case SCE_HP_WORD:
- classifyWordHTPy(styler.GetStartSegment(), i - 1, keywords4, styler, prevWord, inScriptType);
+ classifyWordHTPy(styler.GetStartSegment(), i - 1, keywords4, styler, prevWord, sizeof(prevWord), inScriptType);
break;
case SCE_HPHP_WORD:
classifyWordHTPHP(styler.GetStartSegment(), i - 1, keywords5, styler);
@@ -1369,7 +1369,7 @@ static void ColouriseHyperTextDoc(unsign
break;
case SCE_HP_WORD:
if (!iswordchar(ch)) {
- classifyWordHTPy(styler.GetStartSegment(), i - 1, keywords4, styler, prevWord, inScriptType);
+ classifyWordHTPy(styler.GetStartSegment(), i - 1, keywords4, styler, prevWord, sizeof(prevWord), inScriptType);
state = SCE_HP_DEFAULT;
if (ch == '#') {
state = SCE_HP_COMMENTLINE;