fixed a bug in matching zero occurrence in a group
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: chr.c 127 2009-05-07 13:15:04Z hyunghwan.chung $
|
||||
* $Id: chr.c 204 2009-06-18 12:08:06Z hyunghwan.chung $
|
||||
*
|
||||
Copyright 2006-2009 Chung, Hyung-Hwan.
|
||||
|
||||
@ -113,6 +113,7 @@ qse_bool_t qse_ccls_is (qse_cint_t c, qse_ccls_id_t type)
|
||||
|
||||
qse_cint_t qse_ccls_to (qse_cint_t c, qse_ccls_id_t type)
|
||||
{
|
||||
#ifdef HAVE_WCTRANS
|
||||
static const char* name[] =
|
||||
{
|
||||
"toupper",
|
||||
@ -126,10 +127,16 @@ qse_cint_t qse_ccls_to (qse_cint_t c, qse_ccls_id_t type)
|
||||
};
|
||||
|
||||
QSE_ASSERTX (type >= QSE_CCLS_UPPER && type <= QSE_CCLS_LOWER,
|
||||
"The character type should be one of QSE_CCLS_UPPER and QSE_CCLS_LOWER");
|
||||
"The type should be one of QSE_CCLS_UPPER and QSE_CCLS_LOWER");
|
||||
|
||||
if (desc[type] == (wctrans_t)0) desc[type] = wctrans(name[type]);
|
||||
return towctrans (c, desc[type]);
|
||||
|
||||
#else
|
||||
QSE_ASSERTX (type >= QSE_CCLS_UPPER && type <= QSE_CCLS_LOWER,
|
||||
"The type should be one of QSE_CCLS_UPPER and QSE_CCLS_LOWER");
|
||||
return (type == QSE_CCLS_UPPER)? towupper(c): towlower(c);
|
||||
#endif
|
||||
}
|
||||
|
||||
#else
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: chr_cnv.c 76 2009-02-22 14:18:06Z hyunghwan.chung $
|
||||
* $Id: chr_cnv.c 204 2009-06-18 12:08:06Z hyunghwan.chung $
|
||||
*
|
||||
Copyright 2006-2009 Chung, Hyung-Hwan.
|
||||
|
||||
@ -80,6 +80,15 @@ qse_size_t qse_wctomb (qse_wchar_t wc, qse_mchar_t* mb, qse_size_t mblen)
|
||||
* of a character.
|
||||
*/
|
||||
|
||||
#ifdef _SCO_DS
|
||||
/* SCO defines MB_CUR_MAX as shown below:
|
||||
* extern unsigned char __ctype[];
|
||||
* #define MB_CUR_MAX ((int)__ctype[520])
|
||||
* Some hacks are needed for compilation with a C89 compiler. */
|
||||
# undef MB_CUR_MAX
|
||||
# define MB_CUR_MAX 32
|
||||
#endif
|
||||
|
||||
if (mblen < MB_CUR_MAX)
|
||||
{
|
||||
qse_mchar_t buf[MB_CUR_MAX];
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: fio.c 193 2009-06-08 13:09:01Z hyunghwan.chung $
|
||||
* $Id: fio.c 204 2009-06-18 12:08:06Z hyunghwan.chung $
|
||||
*
|
||||
Copyright 2006-2009 Chung, Hyung-Hwan.
|
||||
|
||||
@ -29,6 +29,9 @@
|
||||
# include <sys/types.h>
|
||||
# include <fcntl.h>
|
||||
# include <limits.h>
|
||||
# ifndef PATH_MAX
|
||||
# define PATH_MAX 2048
|
||||
# endif
|
||||
#endif
|
||||
|
||||
QSE_IMPLEMENT_COMMON_FUNCTIONS (fio)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: rex.c 203 2009-06-17 12:43:50Z hyunghwan.chung $
|
||||
* $Id: rex.c 204 2009-06-18 12:08:06Z hyunghwan.chung $
|
||||
*
|
||||
Copyright 2006-2009 Chung, Hyung-Hwan.
|
||||
|
||||
@ -1726,7 +1726,12 @@ static const qse_byte_t* match_group (
|
||||
mat2.match_ptr = mat->match_ptr;
|
||||
while (si < cp->ubound)
|
||||
{
|
||||
if (mat2.match_ptr >= matcher->match.str.end) break;
|
||||
/* for eol($) check, it should not break when
|
||||
* mat2.match_ptr == matcher->match.str.end.
|
||||
* matcher->match.str.end is one character past the
|
||||
* actual end */
|
||||
/*if (mat2.match_ptr >= matcher->match.str.end) break;*/
|
||||
if (mat2.match_ptr > matcher->match.str.end) break;
|
||||
|
||||
if (match_pattern (matcher, p, &mat2) == QSE_NULL)
|
||||
{
|
||||
|
Reference in New Issue
Block a user