summary refs log tree commit diff
path: root/locale/programs
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-02-11 22:47:21 +0000
committerUlrich Drepper <drepper@redhat.com>2000-02-11 22:47:21 +0000
commita58a476357c95a7b321aee9746af741da95caf32 (patch)
tree4757eb84fd38f83337a0d5ee8fe83e0551206574 /locale/programs
parent740c223996c16b90f9f9f4ec21bbcd143f521eb9 (diff)
downloadglibc-a58a476357c95a7b321aee9746af741da95caf32.tar.gz
glibc-a58a476357c95a7b321aee9746af741da95caf32.tar.xz
glibc-a58a476357c95a7b321aee9746af741da95caf32.zip
Update.
2000-02-11  Ulrich Drepper  <drepper@redhat.com>

	* locale/langinfo.h: Make CRNCYSTR a separate entry instead of an
	alias for CURRENCY_SYMBOL.
	* locale/programs/ld-monetary.c: Add support to write out CRNCYSTR
	information.  [PR libc/1583].
Diffstat (limited to 'locale/programs')
-rw-r--r--locale/programs/ld-monetary.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/locale/programs/ld-monetary.c b/locale/programs/ld-monetary.c
index 24fb2a85eb..7e99b3f514 100644
--- a/locale/programs/ld-monetary.c
+++ b/locale/programs/ld-monetary.c
@@ -84,6 +84,7 @@ struct locale_monetary_t
   uint32_t duo_valid_from;
   uint32_t duo_valid_to;
   uint32_t conversion_rate[2];
+  char *crncystr;
 };
 
 
@@ -345,6 +346,12 @@ not correspond to a valid name in ISO 4217"),
       monetary->conversion_rate[0] = 1;
       monetary->conversion_rate[1] = 1;
     }
+
+  /* Create the crncystr entry.  */
+  monetary->crncystr = (char *) xmalloc (strlen (monetary->currency_symbol)
+					 + 2);
+  monetary->crncystr[0] = monetary->p_cs_precedes ? '-' : '+';
+  strcpy (&monetary->crncystr[1], monetary->currency_symbol);
 }
 
 
@@ -445,6 +452,11 @@ monetary_output (struct localedef_t *locale, struct charmap_t *charmap,
   ++cnt;
 
   idx[cnt - 2] = idx[cnt - 3] + iov[cnt - 1].iov_len;
+  iov[cnt].iov_base = (void *) &monetary->crncystr;
+  iov[cnt].iov_len = strlen (iov[cnt].iov_base) + 1;
+  ++cnt;
+
+  idx[cnt - 2] = idx[cnt - 3] + iov[cnt - 1].iov_len;
   iov[cnt].iov_base = (void *) &monetary->int_p_cs_precedes;
   iov[cnt].iov_len = 1;
   ++cnt;