summaryrefslogtreecommitdiffstats
path: root/intl/dcgettext.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1997-09-01 20:26:57 +0000
committerJim Meyering <jim@meyering.net>1997-09-01 20:26:57 +0000
commit6db9097565a5a9b092226ed75d97bd946ed8412b (patch)
tree154df476c138ca8c3ee72c6b00252bf2e5a85a4e /intl/dcgettext.c
parentdfcc40952ef816208853b54d6fb2b05b23c81a73 (diff)
downloadidutils-6db9097565a5a9b092226ed75d97bd946ed8412b.tar.gz
idutils-6db9097565a5a9b092226ed75d97bd946ed8412b.tar.bz2
idutils-6db9097565a5a9b092226ed75d97bd946ed8412b.zip
update gettext-0.31
Diffstat (limited to 'intl/dcgettext.c')
-rw-r--r--intl/dcgettext.c44
1 files changed, 24 insertions, 20 deletions
diff --git a/intl/dcgettext.c b/intl/dcgettext.c
index 9ce1b3a..c9171de 100644
--- a/intl/dcgettext.c
+++ b/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,7 +290,7 @@ 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;
}
@@ -329,7 +332,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 +351,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 +380,7 @@ DCGETTEXT (domainname, msgid, category)
if (retval != NULL)
{
FREE_BLOCKS (block_list);
- errno = saved_errno;
+ __set_errno (saved_errno);
return retval;
}
}
@@ -538,7 +541,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;
{