diff options
author | Ulrich Drepper <drepper@redhat.com> | 1999-09-12 08:28:56 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1999-09-12 08:28:56 +0000 |
commit | b9eb05d6bfd4c42c8ea614b77cbc50d95fee51d1 (patch) | |
tree | 7d42913f77a3db0fe5f54807a248578fe747e3d1 /locale/programs/locfile.h | |
parent | 0f0e233c0e6a7c3df341566bbbd60917439f9cc9 (diff) | |
download | glibc-b9eb05d6bfd4c42c8ea614b77cbc50d95fee51d1.tar.gz glibc-b9eb05d6bfd4c42c8ea614b77cbc50d95fee51d1.tar.xz glibc-b9eb05d6bfd4c42c8ea614b77cbc50d95fee51d1.zip |
Update.
1999-09-12 Ulrich Drepper <drepper@cygnus.com> * locale/programs/ld-address.c: Fix handling of non-existing definitions for this category. Correctly ignore content of this category is this is necessary. * locale/programs/ld-collate.c: Likewise. * locale/programs/ld-ctype.c: Likewise. * locale/programs/ld-identification.c: Likewise. * locale/programs/ld-measurement.c: Likewise. * locale/programs/ld-messages.c: Likewise. * locale/programs/ld-monetary.c: Likewise. * locale/programs/ld-name.c: Likewise. * locale/programs/ld-numeric.c: Likewise. * locale/programs/ld-paper.c: Likewise. * locale/programs/ld-telephone.c: Likewise. * locale/programs/ld-time.c: Likewise. * locale/programs/locfile.h (handle_copy): Take extra parameter with result pointer. Fill in name of locale from which to copy. Correctly read token after `END'. * locale/programs/localedef.c (main): Correct handling copy. (add_to_readlist): Take extra parameter which says whether we are supposed to read the file or not. (find_locale): Call add_to_readlist with extra parameter set to 0. * locale/programs/localedef.h (struct localedef_t): Use __LC_LAST instead of wrong number in array definitions. (add_to_readlist): Update prototype. * locale/programs/locfile.c (locfile_read): Mark categories not available in source file as read. (write_all_categories): Fix typo.
Diffstat (limited to 'locale/programs/locfile.h')
-rw-r--r-- | locale/programs/locfile.h | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/locale/programs/locfile.h b/locale/programs/locfile.h index 6f670398c0..8117259502 100644 --- a/locale/programs/locfile.h +++ b/locale/programs/locfile.h @@ -47,8 +47,9 @@ struct locale_file /* General handling of `copy'. */ static inline void handle_copy (struct linereader *ldfile, struct charmap_t *charmap, - struct repertoire_t *repertoire, enum token_t token, int locale, - const char *locale_name, int ignore_content) + struct repertoire_t *repertoire, struct localedef_t *result, + enum token_t token, int locale, const char *locale_name, + int ignore_content) { struct token *now; int warned = 0; @@ -62,15 +63,19 @@ handle_copy (struct linereader *ldfile, struct charmap_t *charmap, lr_error (ldfile, _("\ locale name should consist only of portable characters")); else - (void) add_to_readlist (locale, now->val.str.startmb, - repertoire->name); + { + (void) add_to_readlist (locale, now->val.str.startmb, + repertoire->name, 1); + result->copy_name[locale] = now->val.str.startmb; + } } lr_ignore_rest (ldfile, now->tok == tok_string); /* The rest of the line must be empty and the next keyword must be `END xxx'. */ - while (lr_token (ldfile, charmap, NULL)->tok != tok_end) + while ((now = lr_token (ldfile, charmap, NULL))->tok != tok_end + && now->tok != tok_eof) { if (warned == 0) { @@ -82,12 +87,20 @@ no other keyword shall be specified when `copy' is used")); lr_ignore_rest (ldfile, 0); } - /* Handle `END xxx'. */ - if (now->tok != token) - lr_error (ldfile, _("\ + if (now->tok != tok_eof) + { + /* Handle `END xxx'. */ + now = lr_token (ldfile, charmap, NULL); + + if (now->tok != token) + lr_error (ldfile, _("\ `%1$s' definition does not end with `END %1$s'"), locale_name); - lr_ignore_rest (ldfile, now->tok == token); + lr_ignore_rest (ldfile, now->tok == token); + } + else + /* When we come here we reached the end of the file. */ + lr_error (ldfile, _("%s: premature end of file"), locale_name); } |