aboutsummaryrefslogtreecommitdiff
path: root/locale/programs/ld-monetary.c
diff options
context:
space:
mode:
Diffstat (limited to 'locale/programs/ld-monetary.c')
-rw-r--r--locale/programs/ld-monetary.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/locale/programs/ld-monetary.c b/locale/programs/ld-monetary.c
index 4c36c505ba..868ab6980e 100644
--- a/locale/programs/ld-monetary.c
+++ b/locale/programs/ld-monetary.c
@@ -225,14 +225,20 @@ No definition for %s category found"), "LC_MONETARY"));
%s: value of field `int_curr_symbol' has wrong length"),
"LC_MONETARY"));
}
- else if (bsearch (monetary->int_curr_symbol, valid_int_curr,
- NR_VALID_INT_CURR, sizeof (const char *),
- (comparison_fn_t) curr_strcmp) == NULL
+ else
+ { /* Check the first three characters against ISO 4217 */
+ char symbol[4];
+ strncpy (symbol, monetary->int_curr_symbol, 3);
+ symbol[3] = '\0';
+ if (bsearch (symbol, valid_int_curr, NR_VALID_INT_CURR,
+ sizeof (const char *),
+ (comparison_fn_t) curr_strcmp) == NULL
&& !be_quiet)
- WITH_CUR_LOCALE (error (0, 0, _("\
+ WITH_CUR_LOCALE (error (0, 0, _("\
%s: value of field `int_curr_symbol' does \
not correspond to a valid name in ISO 4217"),
"LC_MONETARY"));
+ }
}
/* The decimal point must not be empty. This is not said explicitly