aboutsummaryrefslogtreecommitdiff
path: root/locale
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1996-10-02 01:40:17 +0000
committerUlrich Drepper <drepper@redhat.com>1996-10-02 01:40:17 +0000
commita68b0d31a37a86785b3dbeeee3fad96ee71fadcd (patch)
tree61537b1f028002a9e6e0f5354fced6128bda8b9c /locale
parent2d07133b507b13d4a5ed6dc250f4345c8a26942a (diff)
downloadglibc-a68b0d31a37a86785b3dbeeee3fad96ee71fadcd.zip
glibc-a68b0d31a37a86785b3dbeeee3fad96ee71fadcd.tar.gz
glibc-a68b0d31a37a86785b3dbeeee3fad96ee71fadcd.tar.bz2
update from main archive 961001
Diffstat (limited to 'locale')
-rw-r--r--locale/programs/ld-collate.c2
-rw-r--r--locale/programs/ld-ctype.c1
-rw-r--r--locale/programs/ld-time.c17
-rw-r--r--locale/programs/locale.c7
-rw-r--r--locale/programs/localedef.c7
5 files changed, 23 insertions, 11 deletions
diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c
index a948b55..1bfa533 100644
--- a/locale/programs/ld-collate.c
+++ b/locale/programs/ld-collate.c
@@ -1341,7 +1341,7 @@ collation element `%.*s' appears more than once: ignore line"),
{
unsigned int order = ++collate->order_cnt;
- if ((unsigned int) tmp != 0)
+ if ((unsigned long int) tmp != 0ul)
{
lr_error (lr, _("\
collation symbol `.*s' appears more than once: ignore line"),
diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c
index 196f990..64f73d4 100644
--- a/locale/programs/ld-ctype.c
+++ b/locale/programs/ld-ctype.c
@@ -21,6 +21,7 @@ Boston, MA 02111-1307, USA. */
# include <config.h>
#endif
+#include <alloca.h>
#include <endian.h>
#include <limits.h>
#include <string.h>
diff --git a/locale/programs/ld-time.c b/locale/programs/ld-time.c
index 6f961b6..6fcb069 100644
--- a/locale/programs/ld-time.c
+++ b/locale/programs/ld-time.c
@@ -395,7 +395,8 @@ time_output (struct localedef_t *locale, const char *output_path)
struct iovec iov[2 + _NL_ITEM_INDEX (_NL_NUM_LC_TIME)
+ time->cur_num_era - 1
+ time->cur_num_alt_digits - 1
- + 1 + (time->cur_num_era * 9 - 1) * 2];
+ + 1 + (time->cur_num_era * 9 - 1) * 2
+ + (time->cur_num_era == 0)];
struct locale_file data;
u_int32_t idx[_NL_ITEM_INDEX (_NL_NUM_LC_TIME)];
size_t cnt, last_idx, num;
@@ -635,11 +636,23 @@ time_output (struct localedef_t *locale, const char *output_path)
/* idx[1 + last_idx] += 8 * sizeof (int32_t) + l; */
}
+ /* We have a problem when no era data is present. In this case the
+ data pointer for _NL_TIME_ERA_ENTRIES_EB and
+ _NL_TIME_ERA_ENTRIES_EL point after the end of the file. So we
+ introduce some dummy data here. */
+ if (time->cur_num_era == 0)
+ {
+ static u_int32_t dummy = 0;
+ iov[2 + cnt].iov_base = (void *) &dummy;
+ iov[2 + cnt].iov_len = 4;
+ ++cnt;
+ }
assert (cnt == (_NL_ITEM_INDEX (_NL_NUM_LC_TIME)
+ time->cur_num_era - 1
+ time->cur_num_alt_digits - 1
- + 1 + (time->cur_num_era * 9 - 1) * 2)
+ + 1 + (time->cur_num_era * 9 - 1) * 2
+ + (time->cur_num_era == 0))
&& last_idx + 1 == _NL_ITEM_INDEX (_NL_NUM_LC_TIME));
write_locale_data (output_path, "LC_TIME", 2 + cnt, iov);
diff --git a/locale/programs/locale.c b/locale/programs/locale.c
index 667afbd..fa824fb 100644
--- a/locale/programs/locale.c
+++ b/locale/programs/locale.c
@@ -183,14 +183,13 @@ main (int argc, char *argv[])
/* Version information is requested. */
if (do_version)
{
- fprintf (stderr, "locale (GNU %s) %s\n", PACKAGE, VERSION);
- fprintf (stderr, _("\
+ printf ("locale (GNU %s) %s\n", PACKAGE, VERSION);
+ printf (_("\
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
"), "1995, 1996");
- fprintf (stderr, _("Written by %s.\n"),
- "Ulrich Drepper");
+ printf (_("Written by %s.\n"), "Ulrich Drepper");
exit (EXIT_SUCCESS);
}
diff --git a/locale/programs/localedef.c b/locale/programs/localedef.c
index ff9248e..6d37a0e 100644
--- a/locale/programs/localedef.c
+++ b/locale/programs/localedef.c
@@ -173,14 +173,13 @@ main (int argc, char *argv[])
/* Version information is requested. */
if (do_version)
{
- fprintf (stderr, "localedef (GNU %s) %s\n", PACKAGE, VERSION);
- fprintf (stderr, _("\
+ printf ("localedef (GNU %s) %s\n", PACKAGE, VERSION);
+ printf (_("\
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
"), "1995, 1996");
- fprintf (stderr, _("Written by %s.\n"),
- "Ulrich Drepper");
+ printf (_("Written by %s.\n"), "Ulrich Drepper");
exit (0);
}