aboutsummaryrefslogtreecommitdiffstats
path: root/locale.c
diff options
context:
space:
mode:
authorJari Aalto <jari.aalto@cante.net>2001-04-06 19:14:31 +0000
committerJari Aalto <jari.aalto@cante.net>2009-09-12 16:46:53 +0000
commit28ef6c316f1aff914bb95ac09787a3c83c1815fd (patch)
tree2812fe7ffc9beec4f99856906ddfcafda54cf16a /locale.c
parentbb70624e964126b7ac4ff085ba163a9c35ffa18f (diff)
downloadandroid_external_bash-28ef6c316f1aff914bb95ac09787a3c83c1815fd.tar.gz
android_external_bash-28ef6c316f1aff914bb95ac09787a3c83c1815fd.tar.bz2
android_external_bash-28ef6c316f1aff914bb95ac09787a3c83c1815fd.zip
Imported from ../bash-2.05.tar.gz.
Diffstat (limited to 'locale.c')
-rw-r--r--locale.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/locale.c b/locale.c
index fba962c..39ded78 100644
--- a/locale.c
+++ b/locale.c
@@ -234,12 +234,10 @@ localetrans (string, len, lenp)
if (string == 0 || *string == 0)
{
if (lenp)
- *lenp = 0;
+ *lenp = 0;
return ((char *)NULL);
}
- t = xmalloc (len + 1);
-
locale = get_locale_var ("LC_MESSAGES");
/* If we don't have setlocale() or the current locale is `C' or `POSIX',
@@ -250,6 +248,7 @@ localetrans (string, len, lenp)
(locale[0] == 'C' && locale[1] == '\0') || STREQ (locale, "POSIX"))
#endif
{
+ t = xmalloc (len + 1);
strcpy (t, string);
if (lenp)
*lenp = len;
@@ -261,13 +260,13 @@ localetrans (string, len, lenp)
translated = gettext (string);
if (translated == string) /* gettext returns its argument if untranslatable */
{
+ t = xmalloc (len + 1);
strcpy (t, string);
if (lenp)
*lenp = len;
}
else
{
- free (t);
tlen = strlen (translated);
t = xmalloc (tlen + 1);
strcpy (t, translated);