forked from pool/coreutils
This commit is contained in:
parent
0f9cd3e7de
commit
e7403295f7
@ -1,3 +1,8 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue Jun 24 15:57:01 CEST 2008 - schwab@suse.de
|
||||
|
||||
- Fix sort field limit in multibyte case.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Jun 4 14:10:05 CEST 2008 - schwab@suse.de
|
||||
|
||||
|
@ -17,7 +17,7 @@ Url: http://www.gnu.org/software/coreutils/
|
||||
License: GNU Free Documentation License, Version 1.2 (GFDL 1.2); GPL v2 or later; GPL v3 or later
|
||||
Group: System/Base
|
||||
Version: 6.12
|
||||
Release: 1
|
||||
Release: 2
|
||||
Provides: fileutils sh-utils stat textutils mktemp
|
||||
Obsoletes: fileutils sh-utils stat textutils mktemp
|
||||
Obsoletes: libselinux <= 1.23.11-3 libselinux-32bit >= 9 libselinux-64bit = 9 libselinux-x86 = 9
|
||||
@ -37,6 +37,7 @@ Patch8: coreutils-sysinfo.diff
|
||||
Patch11: i18n-monthsort.diff
|
||||
Patch12: i18n-random.diff
|
||||
Patch16: invalid-ids.diff
|
||||
Patch17: i18n-limfield.diff
|
||||
Patch20: coreutils-6.8-su.diff
|
||||
Patch21: coreutils-6.8.0-pie.diff
|
||||
Patch22: coreutils-5.3.0-sbin4su.diff
|
||||
@ -107,6 +108,7 @@ Authors:
|
||||
%patch11
|
||||
%patch12
|
||||
%patch16 -p1
|
||||
%patch17
|
||||
%patch20
|
||||
%patch21
|
||||
%patch22
|
||||
@ -180,6 +182,8 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%defattr(-,root,root)
|
||||
|
||||
%changelog
|
||||
* Tue Jun 24 2008 schwab@suse.de
|
||||
- Fix sort field limit in multibyte case.
|
||||
* Wed Jun 04 2008 schwab@suse.de
|
||||
- Update to coreutils 6.12.
|
||||
** Bug fixes
|
||||
|
98
i18n-limfield.diff
Normal file
98
i18n-limfield.diff
Normal file
@ -0,0 +1,98 @@
|
||||
--- src/sort.c
|
||||
+++ src/sort.c
|
||||
@@ -1627,7 +1627,7 @@ limfield_mb (const struct line *line, co
|
||||
GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
|
||||
ptr += mblength;
|
||||
}
|
||||
- if (ptr < lim)
|
||||
+ if (ptr < lim && (eword | echar))
|
||||
{
|
||||
GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
|
||||
ptr += mblength;
|
||||
@@ -1638,11 +1638,6 @@ limfield_mb (const struct line *line, co
|
||||
{
|
||||
while (ptr < lim && ismbblank (ptr, &mblength))
|
||||
ptr += mblength;
|
||||
- if (ptr < lim)
|
||||
- {
|
||||
- GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
|
||||
- ptr += mblength;
|
||||
- }
|
||||
while (ptr < lim && !ismbblank (ptr, &mblength))
|
||||
ptr += mblength;
|
||||
}
|
||||
@@ -1652,20 +1647,19 @@ limfield_mb (const struct line *line, co
|
||||
/* Make LIM point to the end of (one byte past) the current field. */
|
||||
if (tab != NULL)
|
||||
{
|
||||
- char *newlim, *p;
|
||||
+ char *newlim;
|
||||
|
||||
- newlim = NULL;
|
||||
- for (p = ptr; p < lim;)
|
||||
- {
|
||||
- if (memcmp (p, tab, tab_length) == 0)
|
||||
- {
|
||||
- newlim = p;
|
||||
- break;
|
||||
- }
|
||||
-
|
||||
- GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
|
||||
- p += mblength;
|
||||
- }
|
||||
+ for (newlim = ptr; newlim < lim;)
|
||||
+ {
|
||||
+ if (memcmp (newlim, tab, tab_length) == 0)
|
||||
+ {
|
||||
+ lim = newlim;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ GET_BYTELEN_OF_CHAR (lim, newlim, mblength, state);
|
||||
+ newlim += mblength;
|
||||
+ }
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1674,24 +1668,20 @@ limfield_mb (const struct line *line, co
|
||||
|
||||
while (newlim < lim && ismbblank (newlim, &mblength))
|
||||
newlim += mblength;
|
||||
- if (ptr < lim)
|
||||
- {
|
||||
- GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
|
||||
- ptr += mblength;
|
||||
- }
|
||||
while (newlim < lim && !ismbblank (newlim, &mblength))
|
||||
- newlim += mblength;
|
||||
+ newlim += mblength;
|
||||
lim = newlim;
|
||||
}
|
||||
# endif
|
||||
|
||||
- /* If we're skipping leading blanks, don't start counting characters
|
||||
- until after skipping past any leading blanks. */
|
||||
+ /* If we're ignoring leading blanks when computing the End
|
||||
+ of the field, don't start counting bytes until after skipping
|
||||
+ past any leading blanks. */
|
||||
if (key->skipeblanks)
|
||||
while (ptr < lim && ismbblank (ptr, &mblength))
|
||||
ptr += mblength;
|
||||
|
||||
- memset (&state, '\0', sizeof(mbstate_t));
|
||||
+ memset (&state, '\0', sizeof (mbstate_t));
|
||||
|
||||
/* Advance PTR by ECHAR (if possible), but no further than LIM. */
|
||||
for (i = 0; i < echar; i++)
|
||||
@@ -1699,9 +1689,9 @@ limfield_mb (const struct line *line, co
|
||||
GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
|
||||
|
||||
if (ptr + mblength > lim)
|
||||
- break;
|
||||
+ break;
|
||||
else
|
||||
- ptr += mblength;
|
||||
+ ptr += mblength;
|
||||
}
|
||||
|
||||
return ptr;
|
Loading…
Reference in New Issue
Block a user