Skip to content

Commit c94c8a5

Browse files
committed
Updated PCRE library from version 8.21 to 8.31
1 parent 285b5d4 commit c94c8a5

File tree

8 files changed

+22
-15
lines changed

8 files changed

+22
-15
lines changed

ProcessPreviousLine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ assemble the full text of the original line.
556556
if (m_bUTF_8)
557557
{
558558
int erroroffset;
559-
iBad = _pcre_valid_utf8 ((const unsigned char *) (const char *) strCurrentLine,
559+
iBad = _pcre_valid_utf ((const unsigned char *) (const char *) strCurrentLine,
560560
strCurrentLine.GetLength (), &erroroffset);
561561
if (iBad > 0)
562562
{

Utilities.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2867,7 +2867,7 @@ int UMessageBox (const char * sText, UINT nType, const char * sTitle)
28672867

28682868
// use PCRE to validate the string first - if bad, fall back to standard box
28692869
int erroroffset;
2870-
iBad = _pcre_valid_utf8 ((unsigned char *) sText, strlen (sText), &erroroffset);
2870+
iBad = _pcre_valid_utf ((unsigned char *) sText, strlen (sText), &erroroffset);
28712871
if (iBad > 0)
28722872
return ::AfxMessageBox (sText, nType);
28732873

@@ -2886,7 +2886,7 @@ int UMessageBox (const char * sText, UINT nType, const char * sTitle)
28862886

28872887
// now do title
28882888

2889-
iBad = _pcre_valid_utf8 ((unsigned char *) sTitle, strlen (sTitle), &erroroffset);
2889+
iBad = _pcre_valid_utf ((unsigned char *) sTitle, strlen (sTitle), &erroroffset);
28902890

28912891
// use PCRE to validate the title next - if bad, use "MUSHclient" title
28922892
if (iBad > 0)

dialogs/DebugWorldInputDlg.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ int nItem = m_ctlSpecials.GetCurSel ();
195195
pCmdUI->Enable(nItem != LB_ERR);
196196
}
197197

198-
extern "C" int _pcre_ord2utf8(int cvalue, unsigned char *buffer);
198+
extern "C" int _pcre_ord2utf(int cvalue, unsigned char *buffer);
199199

200200
void CDebugWorldInputDlg::OnInsertUnicode()
201201
{
@@ -208,7 +208,7 @@ CInsertUnicodeDlg dlg;
208208

209209
unsigned char utf8 [10];
210210

211-
int iLen = _pcre_ord2utf8 (dlg.m_iCode, utf8);
211+
int iLen = _pcre_ord2utf (dlg.m_iCode, utf8);
212212

213213

214214
CString strText;

install/readme.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
MUSHclient version 4.82
22
=======================
33

4-
Tuesday, 3rd January 2012
4+
Tuesday, 22nd September 2012
55

66
Author: Nick Gammon
77
Web support: http://www.gammon.com.au/forum/

miniwindow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ static long CalculateUTF8length (LPCTSTR Text, size_t length)
764764
{
765765

766766
int erroroffset;
767-
int iBad = _pcre_valid_utf8 ((unsigned char *) Text, length, &erroroffset);
767+
int iBad = _pcre_valid_utf ((unsigned char *) Text, length, &erroroffset);
768768
if (iBad > 0)
769769
return -1;
770770

pcre/readme.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
PCRE built as follows:
22

3-
1. Download: ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.21.zip
3+
1. Download: ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.31.zip
44

5-
2. Unzip the file pcre-8.21.zip
5+
2. Unzip the file pcre-8.31.zip
66

77

88
3. Copy the following files to the mushclient source "pcre" directory:
@@ -43,6 +43,7 @@ ucp.h
4343
5. Edit: pcre_compile.c and add:
4444

4545
#pragma warning( disable : 4018) // '<' : signed/unsigned mismatch
46+
#pragma warning( disable : 4127) // conditional expression is constant
4647
#pragma warning( disable : 4244) // conversion from 'int' to 'unsigned short', possible loss of data
4748
#pragma warning( disable : 4701) // local variable 'othercase' may be used without having been initialized
4849

@@ -65,3 +66,9 @@ and add:
6566
to the start of each file.
6667

6768

69+
7. Edit pcre_exec.c and add:
70+
71+
#pragma warning( disable : 4127) // conditional expression is constant
72+
73+
to the start of the file.
74+

scripting/lua_utils.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,7 @@ unsigned char utf8 [10]; // UTF-8 should be max 6 characters
10681068
luaL_error (L,
10691069
"Unicode code (%f) at index [%d] of table at argument #%d to 'utf8encode' has decimal places", f, j, i);
10701070

1071-
int iLen = _pcre_ord2utf8 (n, utf8);
1071+
int iLen = _pcre_ord2utf (n, utf8);
10721072

10731073
// we do it this way so we can correctly append 0x00
10741074
sOutput.append ((const char *) utf8, iLen);
@@ -1090,7 +1090,7 @@ unsigned char utf8 [10]; // UTF-8 should be max 6 characters
10901090
luaL_error (L,
10911091
"Unicode code (%f) at argument #%d to 'utf8encode' has decimal places", f, i);
10921092

1093-
int iLen = _pcre_ord2utf8 (n, utf8);
1093+
int iLen = _pcre_ord2utf (n, utf8);
10941094

10951095
// we do it this way so we can correctly append 0x00
10961096
sOutput.append ((const char *) utf8, iLen);
@@ -1347,7 +1347,7 @@ size_t length;
13471347
const char * data = luaL_checklstring (L, 1, &length);
13481348

13491349
int erroroffset;
1350-
int iBad = _pcre_valid_utf8 ((unsigned char *) data, length, &erroroffset);
1350+
int iBad = _pcre_valid_utf ((unsigned char *) data, length, &erroroffset);
13511351

13521352
if (iBad > 0)
13531353
{
@@ -1393,7 +1393,7 @@ static int utf8sub (lua_State *L) {
13931393
// validate
13941394

13951395
int erroroffset;
1396-
int iBad = _pcre_valid_utf8 ((unsigned char *) s, length, &erroroffset);
1396+
int iBad = _pcre_valid_utf ((unsigned char *) s, length, &erroroffset);
13971397

13981398
if (iBad > 0)
13991399
{

stdafx.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -801,8 +801,8 @@ extern "C"
801801

802802
// stuff we borrow from PCRE
803803

804-
extern "C" int _pcre_valid_utf8(const unsigned char *buf, int length, int * erroroffset);
805-
extern "C" int _pcre_ord2utf8(int cvalue, unsigned char *buffer);
804+
extern "C" int _pcre_valid_utf(const unsigned char *buf, int length, int * erroroffset);
805+
extern "C" int _pcre_ord2utf(int cvalue, unsigned char *buffer);
806806
extern "C" const unsigned char _pcre_utf8_table4[];
807807

808808
// i18n stuff

0 commit comments

Comments
 (0)