Ruediger Oertel 2010-07-14 13:13:42 +00:00 committed by Git OBS Bridge
parent 5ae8424cb7
commit e5d1a797ba
4 changed files with 6 additions and 129 deletions

View File

@ -1,100 +0,0 @@
Index: src/sort.c
===================================================================
--- src/sort.c.orig 2010-05-05 16:22:15.815859271 +0200
+++ src/sort.c 2010-05-05 16:22:15.875859173 +0200
@@ -1845,7 +1845,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;
@@ -1856,11 +1856,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;
}
@@ -1870,20 +1865,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
{
@@ -1892,24 +1886,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++)
@@ -1917,9 +1907,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;

View File

@ -1,13 +0,0 @@
Index: src/sort.c
===================================================================
--- src/sort.c.orig 2010-05-05 16:22:15.487859132 +0200
+++ src/sort.c 2010-05-05 16:23:20.267859249 +0200
@@ -1402,7 +1402,7 @@ inittables_mb (void)
else
{
j += mblength;
- mblength = wcrtomb (mbc, wc, &state_wc);
+ mblength = wcrtomb (mbc, pwc, &state_wc);
assert (mblength != (size_t) 0 && mblength != (size_t) -1);
}

View File

@ -1,16 +0,0 @@
Index: src/sort.c
===================================================================
--- src/sort.c.orig 2010-05-06 15:16:27.475859128 +0200
+++ src/sort.c 2010-05-06 15:16:53.899859247 +0200
@@ -2712,7 +2712,10 @@ keycompare_mb (const struct line *a, con
size_t lenb = limb <= textb ? 0 : limb - textb;
/* Actually compare the fields. */
- if (key->numeric | key->general_numeric)
+
+ if (key->random)
+ diff = compare_random (texta, lena, textb, lenb);
+ else if (key->numeric | key->general_numeric)
{
char savea = *lima, saveb = *limb;

View File

@ -3,6 +3,12 @@ Thu Jul 1 21:23:40 UTC 2010 - jengelh@medozas.de
- Use %_smp_mflags
-------------------------------------------------------------------
Tue Jun 29 20:18:04 CEST 2010 - pth@suse.de
- Fix 'sort -V' not working because the i18n (mb handling) patch
wasn't updated to handle the new option (bnc#615073).
-------------------------------------------------------------------
Mon Jun 28 12:52:15 CEST 2010 - pth@suse.de