From c9f79e0878de5978b3468b7540302c52a12f3392 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 23 Aug 2000 07:44:35 +0000 Subject: (ctype_read): Allow more than one default_missing character being specified, pick the first representable. --- locale/programs/ld-ctype.c | 54 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 38 insertions(+), 16 deletions(-) (limited to 'locale/programs/ld-ctype.c') diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c index f411eac3d3..8904bcad02 100644 --- a/locale/programs/ld-ctype.c +++ b/locale/programs/ld-ctype.c @@ -2688,29 +2688,51 @@ with character code range values one must use the absolute ellipsis `...'")); { uint32_t *wstr; - /* We expect a single character or string as the - argument. */ - now = lr_token (ldfile, charmap, NULL); - wstr = read_widestring (ldfile, now, charmap, repertoire); - - if (wstr != NULL) + while (1) { - if (ctype->default_missing != NULL) + /* We expect a single character or string as the + argument. */ + now = lr_token (ldfile, charmap, NULL); + wstr = read_widestring (ldfile, now, charmap, + repertoire); + + if (wstr != NULL) { - lr_error (ldfile, _("\ + if (ctype->default_missing != NULL) + { + lr_error (ldfile, _("\ %s: duplicate `default_missing' definition"), "LC_CTYPE"); - error_at_line (0, 0, ctype->default_missing_file, - ctype->default_missing_lineno, - _("previous definition was here")); + error_at_line (0, 0, ctype->default_missing_file, + ctype->default_missing_lineno, + _("\ +previous definition was here")); + } + else + { + ctype->default_missing = wstr; + ctype->default_missing_file = ldfile->fname; + ctype->default_missing_lineno = ldfile->lineno; + } + lr_ignore_rest (ldfile, 1); + break; } - else + else if (wstr == (uint32_t *) -1l) + /* This was an syntax error. */ + break; + + /* Maybe there is another replacement we can use. */ + now = lr_token (ldfile, charmap, NULL); + if (now->tok == tok_eol || now->tok == tok_eof) { - ctype->default_missing = wstr; - ctype->default_missing_file = ldfile->fname; - ctype->default_missing_lineno = ldfile->lineno; + /* Nothing found. We tell the user. */ + lr_error (ldfile, _("\ +%s: no representable `default_missing' definition found"), LC_CTYPE); + break; } + if (now->tok != tok_semicolon) + goto translit_syntax; } - lr_ignore_rest (ldfile, 1); + continue; } else if (now->tok == tok_translit_ignore) -- cgit 1.4.1