a8ed68f4f2
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
40 lines
1.5 KiB
Plaintext
40 lines
1.5 KiB
Plaintext
$OpenBSD: patch-src_LexScriptol_cxx,v 1.1.1.1 2003/08/14 18:24:31 sturm Exp $
|
|
--- src/LexScriptol.cxx.orig 2003-08-14 01:23:46.000000000 +1000
|
|
+++ src/LexScriptol.cxx 2003-08-14 01:25:06.000000000 +1000
|
|
@@ -17,7 +17,7 @@
|
|
#include "Scintilla.h"
|
|
#include "SciLexer.h"
|
|
|
|
-static void ClassifyWordSol(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler, char *prevWord)
|
|
+static void ClassifyWordSol(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler, char *prevWord, size_t prevWord_size)
|
|
{
|
|
char s[100];
|
|
bool wordIsNumber = isdigit(styler[start]) != 0;
|
|
@@ -39,7 +39,7 @@ static void ClassifyWordSol(unsigned int
|
|
}
|
|
}
|
|
styler.ColourTo(end, chAttr);
|
|
- strcpy(prevWord, s);
|
|
+ strlcpy(prevWord, s, prevWord_size);
|
|
}
|
|
|
|
static bool IsSolComment(Accessor &styler, int pos, int len)
|
|
@@ -246,7 +246,7 @@ static void ColouriseSolDoc(unsigned int
|
|
{
|
|
if (!iswordchar(ch))
|
|
{
|
|
- ClassifyWordSol(styler.GetStartSegment(), i - 1, keywords, styler, prevWord);
|
|
+ ClassifyWordSol(styler.GetStartSegment(), i - 1, keywords, styler, prevWord, sizeof(prevWord));
|
|
state = SCE_P_DEFAULT;
|
|
if (ch == '`')
|
|
{
|
|
@@ -356,7 +356,7 @@ static void ColouriseSolDoc(unsigned int
|
|
}
|
|
if (state == SCE_P_WORD)
|
|
{
|
|
- ClassifyWordSol(styler.GetStartSegment(), lengthDoc-1, keywords, styler, prevWord);
|
|
+ ClassifyWordSol(styler.GetStartSegment(), lengthDoc-1, keywords, styler, prevWord, sizeof(prevWord));
|
|
}
|
|
else
|
|
{
|