diff options
author | Bruno Haible <bruno@clisp.org> | 2002-01-02 11:09:56 +0000 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2009-06-22 00:30:00 +0200 |
commit | 2926f7270c08f711ca01b5affe49aac7e69f1385 (patch) | |
tree | ef9ff87fd9a5e2d58260ac6cf921f2882e7ccc27 /src | |
parent | 3208bae8f288423491eb4936666763279d59aa8e (diff) | |
download | external_gettext-2926f7270c08f711ca01b5affe49aac7e69f1385.zip external_gettext-2926f7270c08f711ca01b5affe49aac7e69f1385.tar.gz external_gettext-2926f7270c08f711ca01b5affe49aac7e69f1385.tar.bz2 |
Always check the setenv() return value.
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 6 | ||||
-rw-r--r-- | src/msgexec.c | 6 | ||||
-rw-r--r-- | src/msginit.c | 16 |
3 files changed, 17 insertions, 11 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 1b38169..8abc537 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2001-12-23 Bruno Haible <bruno@clisp.org> + + * msgexec.c (process_string): Use xsetenv instead of setenv. + * msginit.c (canonical_locale_charset): Likewise. + (get_title): Likewise. + 2001-12-22 Bruno Haible <bruno@clisp.org> * dir-list.c: Include <stddef.h> instead of <stdlib.h>. diff --git a/src/msgexec.c b/src/msgexec.c index 7dbdae9..7e02bdb 100644 --- a/src/msgexec.c +++ b/src/msgexec.c @@ -46,7 +46,7 @@ #include "findprog.h" #include "pipe.h" #include "wait-process.h" -#include "setenv.h" +#include "xsetenv.h" #include "gettext.h" #define _(str) gettext (str) @@ -321,10 +321,10 @@ process_string (mp, str, len) int exitstatus; /* Set environment variables for the subprocess. */ - setenv ("MSGEXEC_MSGID", mp->msgid, 1); + xsetenv ("MSGEXEC_MSGID", mp->msgid, 1); location = xasprintf ("%s:%ld", mp->pos.file_name, (long) mp->pos.line_number); - setenv ("MSGEXEC_LOCATION", location, 1); + xsetenv ("MSGEXEC_LOCATION", location, 1); free (location); /* Open a pipe to a subprocess. */ diff --git a/src/msginit.c b/src/msginit.c index f999765..83ffb1e 100644 --- a/src/msginit.c +++ b/src/msginit.c @@ -82,7 +82,7 @@ #include "pipe.h" #include "wait-process.h" #include "getline.h" -#include "setenv.h" +#include "xsetenv.h" #include "str-list.h" #include "gettext.h" @@ -648,7 +648,7 @@ canonical_locale_charset () tmp = getenv ("LC_ALL"); old_LC_ALL = (tmp != NULL ? xstrdup (tmp) : NULL); - setenv ("LC_ALL", locale, 1); + xsetenv ("LC_ALL", locale, 1); #ifdef HAVE_SETLOCALE if (setlocale (LC_ALL, "") == NULL) @@ -662,7 +662,7 @@ canonical_locale_charset () /* Restore LC_ALL environment variable. */ if (old_LC_ALL != NULL) - setenv ("LC_ALL", old_LC_ALL, 1), free (old_LC_ALL); + xsetenv ("LC_ALL", old_LC_ALL, 1), free (old_LC_ALL); else unsetenv ("LC_ALL"); @@ -1439,9 +1439,9 @@ get_title () tmp = getenv ("OUTPUT_CHARSET"); old_OUTPUT_CHARSET = (tmp != NULL ? xstrdup (tmp) : NULL); - setenv ("LC_ALL", locale, 1); + xsetenv ("LC_ALL", locale, 1); unsetenv ("LANGUAGE"); - setenv ("OUTPUT_CHARSET", encoding, 1); + xsetenv ("OUTPUT_CHARSET", encoding, 1); #ifdef HAVE_SETLOCALE if (setlocale (LC_ALL, "") == NULL) @@ -1467,17 +1467,17 @@ get_title () /* Restore LC_ALL, LANGUAGE, OUTPUT_CHARSET environment variables. */ if (old_LC_ALL != NULL) - setenv ("LC_ALL", old_LC_ALL, 1), free (old_LC_ALL); + xsetenv ("LC_ALL", old_LC_ALL, 1), free (old_LC_ALL); else unsetenv ("LC_ALL"); if (old_LANGUAGE != NULL) - setenv ("LANGUAGE", old_LANGUAGE, 1), free (old_LANGUAGE); + xsetenv ("LANGUAGE", old_LANGUAGE, 1), free (old_LANGUAGE); else unsetenv ("LANGUAGE"); if (old_OUTPUT_CHARSET != NULL) - setenv ("OUTPUT_CHARSET", old_OUTPUT_CHARSET, 1), free (old_OUTPUT_CHARSET); + xsetenv ("OUTPUT_CHARSET", old_OUTPUT_CHARSET, 1), free (old_OUTPUT_CHARSET); else unsetenv ("OUTPUT_CHARSET"); |