134affccfd
based on diffs from new maintainer Jeremy Evans <jeremyevans0 at gmail.com>
58 lines
2.7 KiB
Plaintext
58 lines
2.7 KiB
Plaintext
$OpenBSD: patch-src_LexHTML_cxx,v 1.2 2007/01/18 10:56:27 steven Exp $
|
|
--- src/LexHTML.cxx.orig Thu Jan 18 08:42:00 2007
|
|
+++ src/LexHTML.cxx Thu Jan 18 08:42:00 2007
|
|
@@ -308,7 +308,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;
|
|
@@ -326,7 +326,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
|
|
@@ -799,7 +799,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);
|
|
@@ -1455,7 +1455,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;
|
|
@@ -1540,7 +1540,7 @@ static void ColouriseHyperTextDoc(unsign
|
|
state = SCE_HPHP_COMMENTLINE;
|
|
} else if (ch == '\"') {
|
|
state = SCE_HPHP_HSTRING;
|
|
- strcpy(phpStringDelimiter, "\"");
|
|
+ strlcpy(phpStringDelimiter, "\"", sizeof(phpStringDelimiter));
|
|
} else if (styler.Match(i, "<<<")) {
|
|
state = SCE_HPHP_HSTRING;
|
|
i = FindPhpStringDelimiter(phpStringDelimiter, sizeof(phpStringDelimiter), i + 3, lengthDoc, styler);
|
|
@@ -1645,7 +1645,7 @@ static void ColouriseHyperTextDoc(unsign
|
|
state = SCE_HPHP_COMMENTLINE;
|
|
} else if (ch == '\"') {
|
|
state = SCE_HPHP_HSTRING;
|
|
- strcpy(phpStringDelimiter, "\"");
|
|
+ strlcpy(phpStringDelimiter, "\"", sizeof(phpStringDelimiter));
|
|
} else if (styler.Match(i, "<<<")) {
|
|
state = SCE_HPHP_HSTRING;
|
|
i = FindPhpStringDelimiter(phpStringDelimiter, sizeof(phpStringDelimiter), i + 3, lengthDoc, styler);
|