aboutsummaryrefslogtreecommitdiff
path: root/catgets/gencat.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-06-29 21:08:13 +0000
committerUlrich Drepper <drepper@redhat.com>2002-06-29 21:08:13 +0000
commiteabea97226515d709064e07485caeb41d413ca44 (patch)
tree4450ce95970fb59807e4ad818bdfdeaf01422d99 /catgets/gencat.c
parenta32c7fb447ed82297343b2d7d6da84b57d3ebca1 (diff)
downloadglibc-eabea97226515d709064e07485caeb41d413ca44.tar
glibc-eabea97226515d709064e07485caeb41d413ca44.tar.gz
glibc-eabea97226515d709064e07485caeb41d413ca44.tar.bz2
glibc-eabea97226515d709064e07485caeb41d413ca44.zip
Update.
2002-06-29 Ulrich Drepper <drepper@redhat.com> * catgets/gencat.c (read_input_file): Handle more than one slash at end of line correctly [PR libc/3926]. Based on a patch by Steven Kim <steven.kim@peregrine.com>. * catgets/sample.SJIS: Add test case for above bug. * catgets/test-gencat.c: Adjust test code. * catgets/test-gencat.sh: Adjust expected results. * elf/do-rel.h (elf_dynamic_do_rel): Avoid overflow in computation to skip relative relocations. Patch by Geoff Keating <geoffk@redhat.com>.
Diffstat (limited to 'catgets/gencat.c')
-rw-r--r--catgets/gencat.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/catgets/gencat.c b/catgets/gencat.c
index 2b6a11fb78..01db830702 100644
--- a/catgets/gencat.c
+++ b/catgets/gencat.c
@@ -325,15 +325,29 @@ read_input_file (struct catalog *current, const char *fname)
++line_number;
/* It the line continued? */
+ continued = 0;
if (buf[act_len - 1] == '\n')
{
--act_len;
- continued = buf[act_len - 1] == '\\';
+
+ /* There might be more than one backslash at the end of
+ the line. Only if there is an odd number of them is
+ the line continued. */
+ if (buf[act_len - 1] == '\\')
+ {
+ int temp_act_len = act_len;
+
+ do
+ {
+ --temp_act_len;
+ continued = !continued;
+ }
+ while (temp_act_len > 0 && buf[temp_act_len - 1] == '\\');
+ }
+
if (continued)
--act_len;
}
- else
- continued = 0;
/* Append to currently selected line. */
obstack_grow (&current->mem_pool, buf, act_len);