This commit is contained in:
yamt 2012-07-30 23:04:42 +00:00
parent a143089ba8
commit 5c3967c0d3
2 changed files with 24 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: dirent.h,v 1.34 2010/09/26 02:26:59 yamt Exp $ */
/* $NetBSD: dirent.h,v 1.35 2012/07/30 23:11:13 yamt Exp $ */
/*-
* Copyright (c) 1989, 1993
@ -56,7 +56,13 @@ typedef struct _dirdesc DIR;
/* structure describing an open directory. */
struct _dirdesc {
/*
* dd_fd should be kept intact to preserve ABI compat. see dirfd().
*/
int dd_fd; /* file descriptor associated with directory */
/*
* the rest is hidden from user.
*/
long dd_loc; /* offset in current buffer */
long dd_size; /* amount of data returned by getdents */
char *dd_buf; /* data buffer */

View File

@ -1,4 +1,4 @@
/* $NetBSD: gettext.c,v 1.27 2012/03/21 10:10:36 matt Exp $ */
/* $NetBSD: gettext.c,v 1.28 2012/07/30 23:04:42 yamt Exp $ */
/*-
* Copyright (c) 2000, 2001 Citrus Project,
@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: gettext.c,v 1.27 2012/03/21 10:10:36 matt Exp $");
__RCSID("$NetBSD: gettext.c,v 1.28 2012/07/30 23:04:42 yamt Exp $");
#include <sys/param.h>
#include <sys/stat.h>
@ -215,6 +215,10 @@ lookup_mofile(char *buf, size_t len, const char *dir, const char *lpath,
char *p, *q;
char lpath_tmp[BUFSIZ];
/*
* LANGUAGE is a colon separated list of locale names.
*/
strlcpy(lpath_tmp, lpath, sizeof(lpath_tmp));
q = lpath_tmp;
/* CONSTCOND */
@ -808,12 +812,21 @@ get_lang_env(const char *category_name)
{
const char *lang;
/* 1. see LANGUAGE variable first. */
/*
* 1. see LANGUAGE variable first.
*
* LANGUAGE is a GNU extension.
* It's a colon separated list of locale names.
*/
lang = getenv("LANGUAGE");
if (lang)
return lang;
/* 2. if LANGUAGE isn't set, see LC_ALL, LC_xxx, LANG. */
/*
* 2. if LANGUAGE isn't set, see LC_ALL, LC_xxx, LANG.
*
* It's essentially setlocale(LC_xxx, NULL).
*/
lang = getenv("LC_ALL");
if (!lang)
lang = getenv(category_name);