summaryrefslogtreecommitdiff
path: root/lib/unicase/u8-casefold.c
diff options
context:
space:
mode:
authorAndreas Rottmann <a.rottmann@gmx.at>2010-05-27 18:23:15 +0200
committerAndreas Rottmann <a.rottmann@gmx.at>2010-05-27 18:23:15 +0200
commit3e0814cd9862b89c7a39672672937477bd87ddfb (patch)
tree159134a624e51509f40ed8823249f09a70d1dda3 /lib/unicase/u8-casefold.c
parent3bebb94360f1c2333feb8d504a9fa4f96984d8b7 (diff)
Imported Upstream version 0.9.3upstream/0.9.3
Diffstat (limited to 'lib/unicase/u8-casefold.c')
-rw-r--r--lib/unicase/u8-casefold.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/lib/unicase/u8-casefold.c b/lib/unicase/u8-casefold.c
index 32108137..e3c91771 100644
--- a/lib/unicase/u8-casefold.c
+++ b/lib/unicase/u8-casefold.c
@@ -1,5 +1,5 @@
/* Casefolding mapping for UTF-8 strings (locale dependent).
- Copyright (C) 2009 Free Software Foundation, Inc.
+ Copyright (C) 2009-2010 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2009.
This program is free software: you can redistribute it and/or modify it
@@ -47,28 +47,28 @@ read_file (FILE *stream)
while (! feof (stream))
{
if (size + BUFSIZE > alloc)
- {
- alloc = alloc + alloc / 2;
- if (alloc < size + BUFSIZE)
- alloc = size + BUFSIZE;
- buf = realloc (buf, alloc);
- if (buf == NULL)
- {
- fprintf (stderr, "out of memory\n");
- exit (1);
- }
- }
+ {
+ alloc = alloc + alloc / 2;
+ if (alloc < size + BUFSIZE)
+ alloc = size + BUFSIZE;
+ buf = realloc (buf, alloc);
+ if (buf == NULL)
+ {
+ fprintf (stderr, "out of memory\n");
+ exit (1);
+ }
+ }
count = fread (buf + size, 1, BUFSIZE, stream);
if (count == 0)
- {
- if (ferror (stream))
- {
- perror ("fread");
- exit (1);
- }
- }
+ {
+ if (ferror (stream))
+ {
+ perror ("fread");
+ exit (1);
+ }
+ }
else
- size += count;
+ size += count;
}
buf = realloc (buf, size + 1);
if (buf == NULL)
@@ -92,9 +92,9 @@ main (int argc, char * argv[])
int length = strlen (input);
size_t output_length;
uint8_t *output =
- u8_casefold ((uint8_t *) input, length, uc_locale_language (),
- NULL,
- NULL, &output_length);
+ u8_casefold ((uint8_t *) input, length, uc_locale_language (),
+ NULL,
+ NULL, &output_length);
fwrite (output, 1, output_length, stdout);