summaryrefslogtreecommitdiff
path: root/string
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-09-11 12:14:37 +0000
committerUlrich Drepper <drepper@redhat.com>1998-09-11 12:14:37 +0000
commit04795ad9025b5f7891eb746fa6f29d1251d2c0b5 (patch)
tree40686d38e2842b7537b699dfb0655b0dfdfd6881 /string
parent5e0889da396b35ef7d57d43dca6f09899e4c8d66 (diff)
downloadglibc-04795ad9025b5f7891eb746fa6f29d1251d2c0b5.tar.gz
Update.
1998-09-11 Ulrich Drepper <drepper@cygnus.com> * resolv/res_init.c (res_init): Handle resolv.conf file with only one nameserver correctly. Patch by HJ Lu. * iconvdata/Makefile (modules): Add IEC_P27-1, BALTIC, ASMO_449, and ANSI_X3.110. Define *-routines variables for new modules. (distribute): Add .c files for new modules. (awk-generated-headers): Add iec_p27-1.h, baltic.h, and asmo_449.h. Add rules for hedaer generation. * iconvdata/gconv-modules: Add entries for new modules. Pretty print. * iconvdata/ansi_x3.110.c: New file. * iconvdata/asmo_449.c: New file. * iconvdata/baltic.c: New file. * iconvdata/iec_p27-1.c: New file. * iconvdata/t61.c (from_ucs4): Correct 0x23, 0x24, 0x80, and 0x81 entries. Convert U02dc correctly. * math/atest-exp.c: Add parentheses to avoid gcc warnings. * math/atest-exp2.c: Likewise. * math/atest-sincos.c: Likewise. * posix/getopt.h: Don't define non-POSIX stuff unless _GNU_SOURCE is defined. 1998-09-11 10:51 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * string/strcoll.c: Optimize a few expressions. * string/strxfrm.c: Likewise.
Diffstat (limited to 'string')
-rw-r--r--string/strcoll.c25
-rw-r--r--string/strxfrm.c10
2 files changed, 17 insertions, 18 deletions
diff --git a/string/strcoll.c b/string/strcoll.c
index f44f6c1f6d..1aab47e3be 100644
--- a/string/strcoll.c
+++ b/string/strcoll.c
@@ -172,31 +172,28 @@ STRCOLL (s1, s2, l)
return w1 < w2 ? -1 : 1;
/* We have to increment the index counters. */
- if ((forward && ++s1idx >= s1run->data[pass].number)
- || (!forward && --s1idx < 0))
+ if (forward)
{
- if (forward)
+ if (++s1idx >= s1run->data[pass].number)
{
s1run = s1run->next;
s1idx = 0;
}
- else
+ if (++s2idx >= s2run->data[pass].number)
{
- s1run = s1run->prev;
- if (s1run != NULL)
- s1idx = s1run->data[pass].number - 1;
+ s2run = s2run->next;
+ s2idx = 0;
}
}
-
- if ((forward && ++s2idx >= s2run->data[pass].number)
- || (!forward && --s2idx < 0))
+ else
{
- if (forward)
+ if (--s1idx < 0)
{
- s2run = s2run->next;
- s2idx = 0;
+ s1run = s1run->prev;
+ if (s1run != NULL)
+ s1idx = s1run->data[pass].number - 1;
}
- else
+ if (--s2idx < 0)
{
s2run = s2run->prev;
if (s2run != NULL)
diff --git a/string/strxfrm.c b/string/strxfrm.c
index 0bdf1069b6..c2b8f48310 100644
--- a/string/strxfrm.c
+++ b/string/strxfrm.c
@@ -249,15 +249,17 @@ STRXFRM (STRING_TYPE *dest, const STRING_TYPE *src, size_t n, __locale_t l)
written = print_val (w, dest, n, written);
/* We have to increment the index counters. */
- if ((forward && ++idx >= run->data[pass].number)
- || (!forward && --idx < 0))
+ if (forward)
{
- if (forward)
+ if (++idx >= run->data[pass].number)
{
run = run->next;
idx = 0;
}
- else
+ }
+ else
+ {
+ if (--idx < 0)
{
run = run->prev;
if (run != NULL)