diff options
Diffstat (limited to 'gnu/usr.bin/texinfo/intl')
-rw-r--r-- | gnu/usr.bin/texinfo/intl/ChangeLog | 55 | ||||
-rw-r--r-- | gnu/usr.bin/texinfo/intl/Makefile.in | 4 | ||||
-rw-r--r-- | gnu/usr.bin/texinfo/intl/VERSION | 2 | ||||
-rw-r--r-- | gnu/usr.bin/texinfo/intl/bindtextdom.c | 62 | ||||
-rw-r--r-- | gnu/usr.bin/texinfo/intl/dcgettext.c | 53 | ||||
-rw-r--r-- | gnu/usr.bin/texinfo/intl/explodename.c | 31 | ||||
-rw-r--r-- | gnu/usr.bin/texinfo/intl/finddomain.c | 46 | ||||
-rw-r--r-- | gnu/usr.bin/texinfo/intl/gettext.c | 26 | ||||
-rw-r--r-- | gnu/usr.bin/texinfo/intl/hash-string.h | 33 | ||||
-rw-r--r-- | gnu/usr.bin/texinfo/intl/l10nflist.c | 47 | ||||
-rw-r--r-- | gnu/usr.bin/texinfo/intl/loadmsgcat.c | 32 | ||||
-rw-r--r-- | gnu/usr.bin/texinfo/intl/localealias.c | 14 | ||||
-rw-r--r-- | gnu/usr.bin/texinfo/intl/textdomain.c | 11 |
13 files changed, 239 insertions, 177 deletions
diff --git a/gnu/usr.bin/texinfo/intl/ChangeLog b/gnu/usr.bin/texinfo/intl/ChangeLog index cfb34fabba7..ecff6f6b2cd 100644 --- a/gnu/usr.bin/texinfo/intl/ChangeLog +++ b/gnu/usr.bin/texinfo/intl/ChangeLog @@ -1,3 +1,58 @@ +1997-09-06 02:10 Ulrich Drepper <drepper@cygnus.com> + + * intlh.inst.in: Reformat copyright. + +1997-08-19 15:22 Ulrich Drepper <drepper@cygnus.com> + + * dcgettext.c (DCGETTEXT): Remove wrong comment. + +1997-08-16 00:13 Ulrich Drepper <drepper@cygnus.com> + + * Makefile.in (install-data): Don't change directory to install. + +1997-08-01 14:30 Ulrich Drepper <drepper@cygnus.com> + + * cat-compat.c: Fix copyright. + + * localealias.c: Don't define strchr unless !HAVE_STRCHR. + + * loadmsgcat.c: Update copyright. Fix typos. + + * l10nflist.c: Don't define strchr unless !HAVE_STRCHR. + (_nl_make_l10nflist): Handle sponsor and revision correctly. + + * gettext.c: Update copyright. + * gettext.h: Likewise. + * hash-string.h: Likewise. + + * finddomain.c: Remoave dead code. Define strchr only if + !HAVE_STRCHR. + + * explodename.c: Include <sys/types.h>. + + * explodename.c: Reformat copyright text. + (_nl_explode_name): Fix typo. + + * dcgettext.c: Define and use __set_errno. + (guess_category_value): Don't use setlocale if HAVE_LC_MESSAGES is + not defined. + + * bindtextdom.c: Pretty printing. + +1997-05-01 02:25 Ulrich Drepper <drepper@cygnus.com> + + * dcgettext.c (guess_category_value): Don't depend on + HAVE_LC_MESSAGES. We don't need the macro here. + Patch by Bruno Haible <haible@ilog.fr>. + + * cat-compat.c (textdomain): DoN't refer to HAVE_SETLOCALE_NULL + macro. Instead use HAVE_LOCALE_NULL and define it when using + glibc, as in dcgettext.c. + Patch by Bruno Haible <haible@ilog.fr>. + + * Makefile.in (CPPFLAGS): New variable. Reported by Franc,ois + Pinard. + Mon Mar 10 06:51:17 1997 Ulrich Drepper <drepper@cygnus.com> * Makefile.in: Implement handling of libtool. diff --git a/gnu/usr.bin/texinfo/intl/Makefile.in b/gnu/usr.bin/texinfo/intl/Makefile.in index 72a697edf4f..a41fb5796b0 100644 --- a/gnu/usr.bin/texinfo/intl/Makefile.in +++ b/gnu/usr.bin/texinfo/intl/Makefile.in @@ -50,6 +50,7 @@ RANLIB = @RANLIB@ DEFS = -DLOCALEDIR=\"$(localedir)\" -DGNULOCALEDIR=\"$(gnulocaledir)\" \ -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" @DEFS@ +CPPFLAGS = @CPPFLAGS@ CFLAGS = @CFLAGS@ LDFLAGS = @LDFLAGS@ @@ -130,10 +131,9 @@ install-data: all $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \ fi; \ $(INSTALL_DATA) VERSION $(gettextsrcdir)/VERSION; \ - cd $(srcdir) && \ dists="$(DISTFILES.common)"; \ for file in $$dists; do \ - $(INSTALL_DATA) $$file $(gettextsrcdir)/$$file; \ + $(INSTALL_DATA) $(srcdir)/$$file $(gettextsrcdir)/$$file; \ done; \ else \ : ; \ diff --git a/gnu/usr.bin/texinfo/intl/VERSION b/gnu/usr.bin/texinfo/intl/VERSION index 7d069b886d6..d31950a61d6 100644 --- a/gnu/usr.bin/texinfo/intl/VERSION +++ b/gnu/usr.bin/texinfo/intl/VERSION @@ -1 +1 @@ -GNU gettext library from gettext-0.10.27 +GNU gettext library from gettext-0.10.32 diff --git a/gnu/usr.bin/texinfo/intl/bindtextdom.c b/gnu/usr.bin/texinfo/intl/bindtextdom.c index 72583f25783..9fcb8d9f29b 100644 --- a/gnu/usr.bin/texinfo/intl/bindtextdom.c +++ b/gnu/usr.bin/texinfo/intl/bindtextdom.c @@ -1,5 +1,5 @@ -/* bindtextdom.c -- implementation of the bindtextdomain(3) function - Copyright (C) 1995, 1996 Free Software Foundation, Inc. +/* Implementation of the bindtextdomain(3) function + Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -34,7 +34,7 @@ void free (); #else # include <strings.h> # ifndef memcpy -# define memcpy(Dst, Src, Num) bcopy ((Src), (Dst), (Num)) +# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num) # endif #endif @@ -61,6 +61,7 @@ extern struct binding *_nl_domain_bindings; prefix. So we have to make a difference here. */ #ifdef _LIBC # define BINDTEXTDOMAIN __bindtextdomain +# define strdup(str) __strdup (str) #else # define BINDTEXTDOMAIN bindtextdomain__ #endif @@ -98,25 +99,36 @@ BINDTEXTDOMAIN (domainname, dirname) if (binding != NULL) { - /* The domain is already bound. Replace the old binding. */ - char *new_dirname; - - if (strcmp (dirname, _nl_default_dirname) == 0) - new_dirname = (char *) _nl_default_dirname; - else + /* The domain is already bound. If the new value and the old + one are equal we simply do nothing. Otherwise replace the + old binding. */ + if (strcmp (dirname, binding->dirname) != 0) { - size_t len = strlen (dirname) + 1; - new_dirname = (char *) malloc (len); - if (new_dirname == NULL) - return NULL; + char *new_dirname; + + if (strcmp (dirname, _nl_default_dirname) == 0) + new_dirname = (char *) _nl_default_dirname; + else + { +#if defined _LIBC || defined HAVE_STRDUP + new_dirname = strdup (dirname); + if (new_dirname == NULL) + return NULL; +#else + size_t len = strlen (dirname) + 1; + new_dirname = (char *) malloc (len); + if (new_dirname == NULL) + return NULL; - memcpy (new_dirname, dirname, len); - } + memcpy (new_dirname, dirname, len); +#endif + } - if (strcmp (binding->dirname, _nl_default_dirname) != 0) - free (binding->dirname); + if (binding->dirname != _nl_default_dirname) + free (binding->dirname); - binding->dirname = new_dirname; + binding->dirname = new_dirname; + } } else { @@ -128,21 +140,33 @@ BINDTEXTDOMAIN (domainname, dirname) if (new_binding == NULL) return NULL; +#if defined _LIBC || defined HAVE_STRDUP + new_binding->domainname = strdup (domainname); + if (new_binding->domainname == NULL) + return NULL; +#else len = strlen (domainname) + 1; new_binding->domainname = (char *) malloc (len); if (new_binding->domainname == NULL) - return NULL; + return NULL; memcpy (new_binding->domainname, domainname, len); +#endif if (strcmp (dirname, _nl_default_dirname) == 0) new_binding->dirname = (char *) _nl_default_dirname; else { +#if defined _LIBC || defined HAVE_STRDUP + new_binding->dirname = strdup (dirname); + if (new_binding->dirname == NULL) + return NULL; +#else len = strlen (dirname) + 1; new_binding->dirname = (char *) malloc (len); if (new_binding->dirname == NULL) return NULL; memcpy (new_binding->dirname, dirname, len); +#endif } /* Now enqueue it. */ diff --git a/gnu/usr.bin/texinfo/intl/dcgettext.c b/gnu/usr.bin/texinfo/intl/dcgettext.c index 9ce1b3a9a1a..a316bfd1086 100644 --- a/gnu/usr.bin/texinfo/intl/dcgettext.c +++ b/gnu/usr.bin/texinfo/intl/dcgettext.c @@ -1,19 +1,19 @@ -/* dcgettext.c -- implementation of the dcgettext(3) function - Copyright (C) 1995, 1996 Free Software Foundation, Inc. +/* Implementation of the dcgettext(3) function + Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H # include <config.h> @@ -42,6 +42,9 @@ char *alloca (); #ifndef errno extern int errno; #endif +#ifndef __set_errno +# define __set_errno(val) errno = (val) +#endif #if defined STDC_HEADERS || defined _LIBC # include <stdlib.h> @@ -273,13 +276,13 @@ DCGETTEXT (domainname, msgid, category) dirname = (char *) alloca (path_max + dirname_len); ADD_BLOCK (block_list, dirname); - errno = 0; + __set_errno (0); while ((ret = getcwd (dirname, path_max)) == NULL && errno == ERANGE) { path_max += PATH_INCR; dirname = (char *) alloca (path_max + dirname_len); ADD_BLOCK (block_list, dirname); - errno = 0; + __set_errno (0); } if (ret == NULL) @@ -287,14 +290,10 @@ DCGETTEXT (domainname, msgid, category) /* We cannot get the current working directory. Don't signal an error but simply return the default string. */ FREE_BLOCKS (block_list); - errno = saved_errno; + __set_errno (saved_errno); return (char *) msgid; } - /* We don't want libintl.a to depend on any other library. So - we avoid the non-standard function stpcpy. In GNU C Library - this function is available, though. Also allow the symbol - HAVE_STPCPY to be defined. */ stpcpy (stpcpy (strchr (dirname, '\0'), "/"), binding->dirname); } @@ -305,10 +304,7 @@ DCGETTEXT (domainname, msgid, category) xdomainname = (char *) alloca (strlen (categoryname) + strlen (domainname) + 5); ADD_BLOCK (block_list, xdomainname); - /* We don't want libintl.a to depend on any other library. So we - avoid the non-standard function stpcpy. In GNU C Library this - function is available, though. Also allow the symbol HAVE_STPCPY - to be defined. */ + stpcpy (stpcpy (stpcpy (stpcpy (xdomainname, categoryname), "/"), domainname), ".mo"); @@ -329,7 +325,7 @@ DCGETTEXT (domainname, msgid, category) { /* The whole contents of CATEGORYVALUE has been searched but no valid entry has been found. We solve this situation - by implicitely appending a "C" entry, i.e. no translation + by implicitly appending a "C" entry, i.e. no translation will take place. */ single_locale[0] = 'C'; single_locale[1] = '\0'; @@ -348,7 +344,7 @@ DCGETTEXT (domainname, msgid, category) || strcmp (single_locale, "POSIX") == 0) { FREE_BLOCKS (block_list); - errno = saved_errno; + __set_errno (saved_errno); return (char *) msgid; } @@ -377,7 +373,7 @@ DCGETTEXT (domainname, msgid, category) if (retval != NULL) { FREE_BLOCKS (block_list); - errno = saved_errno; + __set_errno (saved_errno); return retval; } } @@ -538,7 +534,8 @@ category_to_name (category) } /* Guess value of current locale from value of the environment variables. */ -static const char *guess_category_value (category, categoryname) +static const char * +guess_category_value (category, categoryname) int category; const char *categoryname; { diff --git a/gnu/usr.bin/texinfo/intl/explodename.c b/gnu/usr.bin/texinfo/intl/explodename.c index 64b0a036c0c..37c46e9d7b8 100644 --- a/gnu/usr.bin/texinfo/intl/explodename.c +++ b/gnu/usr.bin/texinfo/intl/explodename.c @@ -1,21 +1,19 @@ -/* Copyright (C) 1995, 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. -Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. +/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H # include <config.h> @@ -23,6 +21,7 @@ Boston, MA 02111-1307, USA. */ #include <stdlib.h> #include <string.h> +#include <sys/types.h> #include "loadinfo.h" @@ -164,7 +163,7 @@ _nl_explode_name (name, language, modifier, territory, codeset, } } - /* For CEN sytnax values it might be important to have the + /* For CEN syntax values it might be important to have the separator character in the file name, not for XPG syntax. */ if (syntax == xpg) { diff --git a/gnu/usr.bin/texinfo/intl/finddomain.c b/gnu/usr.bin/texinfo/intl/finddomain.c index 3b7861e8472..ec85d4de4d1 100644 --- a/gnu/usr.bin/texinfo/intl/finddomain.c +++ b/gnu/usr.bin/texinfo/intl/finddomain.c @@ -1,5 +1,5 @@ -/* finddomain.c -- handle list of needed message catalogs - Copyright (C) 1995, 1996 Free Software Foundation, Inc. +/* Handle list of needed message catalogs + Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. This program is free software; you can redistribute it and/or modify @@ -39,12 +39,14 @@ void free (); # include <string.h> #else # include <strings.h> +# ifndef memcpy +# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num) +# endif +#endif +#if !HAVE_STRCHR && !defined _LIBC # ifndef strchr # define strchr index # endif -# ifndef memcpy -# define memcpy(Dst, Src, Num) bcopy ((Src), (Dst), (Num)) -# endif #endif #if defined HAVE_UNISTD_H || defined _LIBC @@ -60,18 +62,6 @@ void free (); #endif /* @@ end of prolog @@ */ - -#ifdef _LIBC -/* Rename the non ANSI C functions. This is required by the standard - because some ANSI C functions will require linking with this object - file and the name space must not be polluted. */ -# define stpcpy(dest, src) __stpcpy(dest, src) -#else -# ifndef HAVE_STPCPY -static char *stpcpy PARAMS ((char *dest, const char *src)); -# endif -#endif - /* List of already loaded domains. */ static struct loaded_l10nfile *_nl_loaded_domains; @@ -103,7 +93,7 @@ _nl_find_domain (dirname, locale, domainname) and six parts for the CEN syntax: - language[_territory][+audience][+special][,sponsor][_revision] + language[_territory][+audience][+special][,[sponsor][_revision]] Beside the first all of them are allowed to be missing. If the full specified locale is not found, the less specific one are @@ -168,7 +158,7 @@ _nl_find_domain (dirname, locale, domainname) &sponsor, &revision); /* Create all possible locale entries which might be interested in - generalzation. */ + generalization. */ retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname, strlen (dirname) + 1, mask, language, territory, codeset, normalized_codeset, modifier, special, @@ -197,21 +187,3 @@ _nl_find_domain (dirname, locale, domainname) return retval; } - -/* @@ begin of epilog @@ */ - -/* We don't want libintl.a to depend on any other library. So we - avoid the non-standard function stpcpy. In GNU C Library this - function is available, though. Also allow the symbol HAVE_STPCPY - to be defined. */ -#if !_LIBC && !HAVE_STPCPY -static char * -stpcpy (dest, src) - char *dest; - const char *src; -{ - while ((*dest++ = *src++) != '\0') - /* Do nothing. */ ; - return dest - 1; -} -#endif diff --git a/gnu/usr.bin/texinfo/intl/gettext.c b/gnu/usr.bin/texinfo/intl/gettext.c index 7bed6369b44..1336d21e7c9 100644 --- a/gnu/usr.bin/texinfo/intl/gettext.c +++ b/gnu/usr.bin/texinfo/intl/gettext.c @@ -1,19 +1,19 @@ -/* gettext.c -- implementation of gettext(3) function - Copyright (C) 1995 Software Foundation, Inc. +/* Implementation of gettext(3) function + Copyright (C) 1995, 1997 Free Software Foundation, Inc. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H # include <config.h> diff --git a/gnu/usr.bin/texinfo/intl/hash-string.h b/gnu/usr.bin/texinfo/intl/hash-string.h index ef1f448d865..e66e8417a97 100644 --- a/gnu/usr.bin/texinfo/intl/hash-string.h +++ b/gnu/usr.bin/texinfo/intl/hash-string.h @@ -1,19 +1,20 @@ -/* hash-string - Implements a string hashing function. - Copyright (C) 1995 Free Software Foundation, Inc. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* Implements a string hashing function. + Copyright (C) 1995, 1997 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #ifdef HAVE_VALUES_H # include <values.h> diff --git a/gnu/usr.bin/texinfo/intl/l10nflist.c b/gnu/usr.bin/texinfo/intl/l10nflist.c index 3611b12904f..4e2bc130950 100644 --- a/gnu/usr.bin/texinfo/intl/l10nflist.c +++ b/gnu/usr.bin/texinfo/intl/l10nflist.c @@ -1,5 +1,5 @@ -/* finddomain.c -- handle list of needed message catalogs - Copyright (C) 1995, 1996 Free Software Foundation, Inc. +/* Handle list of needed message catalogs + Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. This program is free software; you can redistribute it and/or modify @@ -20,6 +20,7 @@ # include <config.h> #endif + #if defined HAVE_STRING_H || defined _LIBC # ifndef _GNU_SOURCE # define _GNU_SOURCE 1 @@ -27,18 +28,21 @@ # include <string.h> #else # include <strings.h> +# ifndef memcpy +# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num) +# endif +#endif +#if !HAVE_STRCHR && !defined _LIBC # ifndef strchr # define strchr index # endif -# ifndef memcpy -# define memcpy(Dst, Src, Num) bcopy ((Src), (Dst), (Num)) -# endif #endif #if defined _LIBC || defined HAVE_ARGZ_H # include <argz.h> #endif #include <ctype.h> +#include <sys/types.h> #if defined STDC_HEADERS || defined _LIBC # include <stdlib.h> @@ -198,14 +202,16 @@ _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language, + ((mask & XPG_NORM_CODESET) != 0 ? strlen (normalized_codeset) + 1 : 0) + (((mask & XPG_MODIFIER) != 0 - || (mask & CEN_AUDIENCE) != 0) ? - strlen (modifier) + 1 : 0) + || (mask & CEN_AUDIENCE) != 0) + ? strlen (modifier) + 1 : 0) + ((mask & CEN_SPECIAL) != 0 ? strlen (special) + 1 : 0) - + ((mask & CEN_SPONSOR) != 0 - ? strlen (sponsor) + 1 : 0) - + ((mask & CEN_REVISION) != 0 - ? strlen (revision) + 1 : 0) + + (((mask & CEN_SPONSOR) != 0 + || (mask & CEN_REVISION) != 0) + ? (1 + ((mask & CEN_SPONSOR) != 0 + ? strlen (sponsor) + 1 : 0) + + ((mask & CEN_REVISION) != 0 + ? strlen (revision) + 1 : 0)) : 0) + 1 + strlen (filename) + 1); if (abs_filename == NULL) @@ -248,15 +254,16 @@ _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language, *cp++ = '+'; cp = stpcpy (cp, special); } - if ((mask & CEN_SPONSOR) != 0) + if ((mask & (CEN_SPONSOR | CEN_REVISION)) != 0) { *cp++ = ','; - cp = stpcpy (cp, sponsor); - } - if ((mask & CEN_REVISION) != 0) - { - *cp++ = '_'; - cp = stpcpy (cp, revision); + if ((mask & CEN_SPONSOR) != 0) + cp = stpcpy (cp, sponsor); + if ((mask & CEN_REVISION) != 0) + { + *cp++ = '_'; + cp = stpcpy (cp, revision); + } } *cp++ = '/'; @@ -313,8 +320,8 @@ _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language, } entries = 0; - /* If the DIRLIST is a real list the RETVAL entry correcponds not to - a real file. So we have to use the DIRLIST separation machanism + /* If the DIRLIST is a real list the RETVAL entry corresponds not to + a real file. So we have to use the DIRLIST separation mechanism of the inner loop. */ cnt = __argz_count (dirlist, dirlist_len) == 1 ? mask - 1 : mask; for (; cnt >= 0; --cnt) diff --git a/gnu/usr.bin/texinfo/intl/loadmsgcat.c b/gnu/usr.bin/texinfo/intl/loadmsgcat.c index 4b98ec80671..73e90a9190f 100644 --- a/gnu/usr.bin/texinfo/intl/loadmsgcat.c +++ b/gnu/usr.bin/texinfo/intl/loadmsgcat.c @@ -1,19 +1,19 @@ -/* loadmsgcat.c -- load needed message catalogs - Copyright (C) 1995, 1996 Free Software Foundation, Inc. +/* Load needed message catalogs + Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H # include <config.h> @@ -41,8 +41,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* @@ end of prolog @@ */ #ifdef _LIBC -/* Rename the non ANSI C functions. This is required by the standard - because some ANSI C functions will require linking with this object +/* Rename the non ISO C functions. This is required by the standard + because some ISO C functions will require linking with this object file and the name space must not be polluted. */ # define fstat __fstat # define open __open @@ -55,7 +55,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* We need a sign, whether a new catalog was loaded, which can be associated with all translations. This is important if the translations are cached by one of GCC's features. */ -int _nl_msg_cat_cntr; +int _nl_msg_cat_cntr = 0; /* Load the message catalogs specified by FILENAME. If it is no valid diff --git a/gnu/usr.bin/texinfo/intl/localealias.c b/gnu/usr.bin/texinfo/intl/localealias.c index a869acf6a6c..00d91941b9b 100644 --- a/gnu/usr.bin/texinfo/intl/localealias.c +++ b/gnu/usr.bin/texinfo/intl/localealias.c @@ -1,5 +1,5 @@ -/* localealias.c -- handle aliases for locale names - Copyright (C) 1995, 1996 Free Software Foundation, Inc. +/* Handle aliases for locale names + Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. This program is free software; you can redistribute it and/or modify @@ -59,12 +59,14 @@ void free (); # include <string.h> #else # include <strings.h> +# ifndef memcpy +# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num) +# endif +#endif +#if !HAVE_STRCHR && !defined _LIBC # ifndef strchr # define strchr index # endif -# ifndef memcpy -# define memcpy(Dst, Src, Num) bcopy ((Src), (Dst), (Num)) -# endif #endif #include "gettext.h" @@ -295,7 +297,7 @@ read_alias_file (fname, fname_len) } } - /* Possibily not the whole line fitted into the buffer. Ignore + /* Possibly not the whole line fits into the buffer. Ignore the rest of the line. */ while (strchr (cp, '\n') == NULL) { diff --git a/gnu/usr.bin/texinfo/intl/textdomain.c b/gnu/usr.bin/texinfo/intl/textdomain.c index 09530b8f75b..55d93406a8a 100644 --- a/gnu/usr.bin/texinfo/intl/textdomain.c +++ b/gnu/usr.bin/texinfo/intl/textdomain.c @@ -1,5 +1,5 @@ -/* textdomain.c -- implementation of the textdomain(3) function - Copyright (C) 1995, 1996 Free Software Foundation, Inc. +/* Implementation of the textdomain(3) function + Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. This program is free software; you can redistribute it and/or modify @@ -29,7 +29,7 @@ #else # include <strings.h> # ifndef memcpy -# define memcpy(Dst, Src, Num) bcopy ((Src), (Dst), (Num)) +# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num) # endif #endif @@ -54,6 +54,7 @@ extern const char *_nl_current_default_domain; prefix. So we have to make a difference here. */ #ifdef _LIBC # define TEXTDOMAIN __textdomain +# define strdup(str) __strdup (str) #else # define TEXTDOMAIN textdomain__ #endif @@ -82,11 +83,15 @@ TEXTDOMAIN (domainname) /* If the following malloc fails `_nl_current_default_domain' will be NULL. This value will be returned and so signals we are out of core. */ +#if defined _LIBC || defined HAVE_STRDUP + _nl_current_default_domain = strdup (domainname); +#else size_t len = strlen (domainname) + 1; char *cp = (char *) malloc (len); if (cp != NULL) memcpy (cp, domainname, len); _nl_current_default_domain = cp; +#endif } if (old != _nl_default_default_domain) |