This commit is contained in:
parent
5b8d935d00
commit
fc2d1d0edd
@ -416,7 +416,7 @@
|
|||||||
|
|
||||||
#define NCHAR (UCHAR_MAX + 1)
|
#define NCHAR (UCHAR_MAX + 1)
|
||||||
|
|
||||||
@@ -140,40 +141,62 @@ kwsmusts (void)
|
@@ -140,40 +141,60 @@ kwsmusts (void)
|
||||||
are not single byte character nor the first byte of a multibyte
|
are not single byte character nor the first byte of a multibyte
|
||||||
character. Caller must free the array. */
|
character. Caller must free the array. */
|
||||||
static char*
|
static char*
|
||||||
@ -447,18 +447,22 @@
|
|||||||
+ wc = buf[i];
|
+ wc = buf[i];
|
||||||
+ if (case_convert && iswupper ((wint_t)wc))
|
+ if (case_convert && iswupper ((wint_t)wc))
|
||||||
+ wc = towlower ((wint_t) wc);
|
+ wc = towlower ((wint_t) wc);
|
||||||
+ }
|
}
|
||||||
|
- else if (match_icase)
|
||||||
+ else
|
+ else
|
||||||
+ {
|
{
|
||||||
|
- if (iswupper((wint_t)wc))
|
||||||
+ in_shift = true;
|
+ in_shift = true;
|
||||||
+ mbclen = mbrtowc(&wc, buf + i, size - i, &cur_state);
|
+ mbclen = mbrtowc(&wc, buf + i, size - i, &cur_state);
|
||||||
+
|
+
|
||||||
+ if (mbclen == (size_t) -1 || mbclen == (size_t) -2 || mbclen == 0)
|
+ if (mbclen == (size_t) -1 || mbclen == (size_t) -2 || mbclen == 0)
|
||||||
+ {
|
{
|
||||||
|
- wc = towlower((wint_t)wc);
|
||||||
|
- wcrtomb(buf + i, wc, &cur_state);
|
||||||
+ /* An invalid sequence, or a truncated multibyte character.
|
+ /* An invalid sequence, or a truncated multibyte character.
|
||||||
+ We treat it as a single byte character. */
|
+ We treat it as a single byte character. */
|
||||||
+ mbclen = 1;
|
+ mbclen = 1;
|
||||||
+ }
|
}
|
||||||
+ else if (case_convert)
|
+ else if (case_convert)
|
||||||
+ {
|
+ {
|
||||||
+ if (iswupper((wint_t)wc))
|
+ if (iswupper((wint_t)wc))
|
||||||
@ -469,21 +473,15 @@
|
|||||||
+ }
|
+ }
|
||||||
+ if (mbsinit (&cur_state))
|
+ if (mbsinit (&cur_state))
|
||||||
+ in_shift = false;
|
+ in_shift = false;
|
||||||
}
|
+ }
|
||||||
- else if (match_icase)
|
+ if (mbclen != 1 && !mb_properties)
|
||||||
+ if (mbclen != 1)
|
+ {
|
||||||
{
|
+ mb_properties = xcalloc (1, size);
|
||||||
- if (iswupper((wint_t)wc))
|
+ memset (mb_properties, 1, i);
|
||||||
+ if (!mb_properties)
|
|
||||||
{
|
|
||||||
- wc = towlower((wint_t)wc);
|
|
||||||
- wcrtomb(buf + i, wc, &cur_state);
|
|
||||||
+ mb_properties = xcalloc (1, size);
|
|
||||||
+ memset (mb_properties, 1, i);
|
|
||||||
}
|
|
||||||
+ mb_properties[i] = mbclen;
|
|
||||||
}
|
}
|
||||||
- mb_properties[i] = mbclen;
|
- mb_properties[i] = mbclen;
|
||||||
|
+ if (mb_properties)
|
||||||
|
+ mb_properties[i] = mbclen;
|
||||||
i += mbclen;
|
i += mbclen;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -492,7 +490,7 @@
|
|||||||
}
|
}
|
||||||
#endif /* MBS_SUPPORT */
|
#endif /* MBS_SUPPORT */
|
||||||
|
|
||||||
@@ -311,9 +334,8 @@ EXECUTE_FCT(EGexecute)
|
@@ -311,9 +332,8 @@ EXECUTE_FCT(EGexecute)
|
||||||
if (start_ptr)
|
if (start_ptr)
|
||||||
start_ptr = case_buf + (start_ptr - buf);
|
start_ptr = case_buf + (start_ptr - buf);
|
||||||
buf = case_buf;
|
buf = case_buf;
|
||||||
@ -503,7 +501,7 @@
|
|||||||
}
|
}
|
||||||
#endif /* MBS_SUPPORT */
|
#endif /* MBS_SUPPORT */
|
||||||
|
|
||||||
@@ -336,8 +358,14 @@ EXECUTE_FCT(EGexecute)
|
@@ -336,8 +356,14 @@ EXECUTE_FCT(EGexecute)
|
||||||
end = memchr(beg, eol, buflim - beg);
|
end = memchr(beg, eol, buflim - beg);
|
||||||
end++;
|
end++;
|
||||||
#ifdef MBS_SUPPORT
|
#ifdef MBS_SUPPORT
|
||||||
@ -520,7 +518,7 @@
|
|||||||
#endif
|
#endif
|
||||||
while (beg > buf && beg[-1] != eol)
|
while (beg > buf && beg[-1] != eol)
|
||||||
--beg;
|
--beg;
|
||||||
@@ -478,7 +506,7 @@ EXECUTE_FCT(EGexecute)
|
@@ -478,7 +504,7 @@ EXECUTE_FCT(EGexecute)
|
||||||
{
|
{
|
||||||
if (match_icase)
|
if (match_icase)
|
||||||
free((char*)buf);
|
free((char*)buf);
|
||||||
@ -529,7 +527,7 @@
|
|||||||
free(mb_properties);
|
free(mb_properties);
|
||||||
}
|
}
|
||||||
#endif /* MBS_SUPPORT */
|
#endif /* MBS_SUPPORT */
|
||||||
@@ -527,8 +555,8 @@ EXECUTE_FCT(Fexecute)
|
@@ -527,8 +553,8 @@ EXECUTE_FCT(Fexecute)
|
||||||
if (start_ptr)
|
if (start_ptr)
|
||||||
start_ptr = case_buf + (start_ptr - buf);
|
start_ptr = case_buf + (start_ptr - buf);
|
||||||
buf = case_buf;
|
buf = case_buf;
|
||||||
@ -539,7 +537,7 @@
|
|||||||
}
|
}
|
||||||
#endif /* MBS_SUPPORT */
|
#endif /* MBS_SUPPORT */
|
||||||
|
|
||||||
@@ -538,8 +566,14 @@ EXECUTE_FCT(Fexecute)
|
@@ -538,8 +564,14 @@ EXECUTE_FCT(Fexecute)
|
||||||
if (offset == (size_t) -1)
|
if (offset == (size_t) -1)
|
||||||
goto failure;
|
goto failure;
|
||||||
#ifdef MBS_SUPPORT
|
#ifdef MBS_SUPPORT
|
||||||
@ -556,7 +554,7 @@
|
|||||||
#endif /* MBS_SUPPORT */
|
#endif /* MBS_SUPPORT */
|
||||||
beg += offset;
|
beg += offset;
|
||||||
len = kwsmatch.size[0];
|
len = kwsmatch.size[0];
|
||||||
@@ -595,7 +629,7 @@ EXECUTE_FCT(Fexecute)
|
@@ -595,7 +627,7 @@ EXECUTE_FCT(Fexecute)
|
||||||
{
|
{
|
||||||
if (match_icase)
|
if (match_icase)
|
||||||
free((char*)buf);
|
free((char*)buf);
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Jun 3 11:29:37 CEST 2008 - schwab@suse.de
|
||||||
|
|
||||||
|
- Fix last change.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue May 27 18:45:20 CEST 2008 - schwab@suse.de
|
Tue May 27 18:45:20 CEST 2008 - schwab@suse.de
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ Provides: base:/usr/bin/grep
|
|||||||
AutoReqProv: on
|
AutoReqProv: on
|
||||||
PreReq: %{install_info_prereq}
|
PreReq: %{install_info_prereq}
|
||||||
Version: 2.5.2
|
Version: 2.5.2
|
||||||
Release: 69
|
Release: 72
|
||||||
Summary: Print lines matching a pattern
|
Summary: Print lines matching a pattern
|
||||||
Source: grep-%{version}.tar.bz2
|
Source: grep-%{version}.tar.bz2
|
||||||
Patch: grep-%{version}.diff
|
Patch: grep-%{version}.diff
|
||||||
@ -95,6 +95,8 @@ ln -sf ../../bin/grep $RPM_BUILD_ROOT/usr/bin/grep
|
|||||||
%doc %{_infodir}/*.gz
|
%doc %{_infodir}/*.gz
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Jun 03 2008 schwab@suse.de
|
||||||
|
- Fix last change.
|
||||||
* Tue May 27 2008 schwab@suse.de
|
* Tue May 27 2008 schwab@suse.de
|
||||||
- Some speadups.
|
- Some speadups.
|
||||||
* Mon Feb 11 2008 schwab@suse.de
|
* Mon Feb 11 2008 schwab@suse.de
|
||||||
|
Loading…
Reference in New Issue
Block a user