catopen.c (7257d1b4) | catopen.c (b599bd93) |
---|---|
1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 10 unchanged lines hidden (view full) --- 19 * CDDL HEADER END 20 */ 21 22/* 23 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 24 * Use is subject to license terms. 25 */ 26 | 1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 10 unchanged lines hidden (view full) --- 19 * CDDL HEADER END 20 */ 21 22/* 23 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 24 * Use is subject to license terms. 25 */ 26 |
27#pragma ident "%Z%%M% %I% %E% SMI" 28 | |
29/* 30 * catopen.c 31 * 32 */ 33 34#pragma weak _catopen = catopen 35#pragma weak _catclose = catclose 36 --- 61 unchanged lines hidden (view full) --- 98 /* 99 * locale=language_territory.codeset 100 * XPG4 uses LC_MESSAGES. 101 * XPG3 uses LANG. 102 * From the following two lines, choose one depending on XPG3 or 4. 103 * 104 * Chose XPG4. If oflag == NL_CAT_LOCALE, use LC_MESSAGES. 105 */ | 27/* 28 * catopen.c 29 * 30 */ 31 32#pragma weak _catopen = catopen 33#pragma weak _catclose = catclose 34 --- 61 unchanged lines hidden (view full) --- 96 /* 97 * locale=language_territory.codeset 98 * XPG4 uses LC_MESSAGES. 99 * XPG3 uses LANG. 100 * From the following two lines, choose one depending on XPG3 or 4. 101 * 102 * Chose XPG4. If oflag == NL_CAT_LOCALE, use LC_MESSAGES. 103 */ |
106 if (oflag == NL_CAT_LOCALE) 107 locale = setlocale(LC_MESSAGES, NULL); 108 else | 104 if (oflag == NL_CAT_LOCALE) { 105 locale_t loc = uselocale(NULL); 106 locale = current_locale(loc, LC_MESSAGES); 107 } else { |
109 locale = getenv("LANG"); | 108 locale = getenv("LANG"); |
109 } |
|
110 111 nlspath = getenv("NLSPATH"); 112 lang = NULL; 113 if (nlspath) { 114 territory = NULL; 115 codeset = NULL; 116 /* 117 * extract lang, territory and codeset from locale name --- 219 unchanged lines hidden --- | 110 111 nlspath = getenv("NLSPATH"); 112 lang = NULL; 113 if (nlspath) { 114 territory = NULL; 115 codeset = NULL; 116 /* 117 * extract lang, territory and codeset from locale name --- 219 unchanged lines hidden --- |