wdresolve.c (7257d1b4) | wdresolve.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#include "lint.h" 30#include "mtlib.h" 31#include <sys/types.h> 32#include <ctype.h> 33#include <string.h> 34#include <stdlib.h> 35#include <euc.h> 36#include <widec.h> --- 22 unchanged lines hidden (view full) --- 59static int 60_wdinitialize(void) 61{ 62#define _DFLTLOCPATH_LEN (sizeof (_DFLT_LOC_PATH) - 1) 63#define _WDMODPATH_LEN (sizeof (_WDMOD_PATH) - 1) 64 char wdmodpath[PATH_MAX]; 65 char *loc; 66 size_t loclen; | 27#include "lint.h" 28#include "mtlib.h" 29#include <sys/types.h> 30#include <ctype.h> 31#include <string.h> 32#include <stdlib.h> 33#include <euc.h> 34#include <widec.h> --- 22 unchanged lines hidden (view full) --- 57static int 58_wdinitialize(void) 59{ 60#define _DFLTLOCPATH_LEN (sizeof (_DFLT_LOC_PATH) - 1) 61#define _WDMODPATH_LEN (sizeof (_WDMOD_PATH) - 1) 62 char wdmodpath[PATH_MAX]; 63 char *loc; 64 size_t loclen; |
65 locale_t curloc; |
|
67 68 initialized = 1; 69 70 if (modhandle) 71 (void) dlclose(modhandle); 72 | 66 67 initialized = 1; 68 69 if (modhandle) 70 (void) dlclose(modhandle); 71 |
73 loc = setlocale(LC_CTYPE, NULL); /* this never return NULL */ | 72 curloc = uselocale(NULL); 73 loc = current_locale(curloc, LC_CTYPE); |
74 loclen = strlen(loc); 75 if (_DFLTLOCPATH_LEN + loclen + _WDMODPATH_LEN >= sizeof (wdmodpath)) { 76 /* pathname too long */ 77 modhandle = NULL; 78 goto C_fallback; 79 } 80 81 (void) strcpy(wdmodpath, _DFLT_LOC_PATH); --- 186 unchanged lines hidden --- | 74 loclen = strlen(loc); 75 if (_DFLTLOCPATH_LEN + loclen + _WDMODPATH_LEN >= sizeof (wdmodpath)) { 76 /* pathname too long */ 77 modhandle = NULL; 78 goto C_fallback; 79 } 80 81 (void) strcpy(wdmodpath, _DFLT_LOC_PATH); --- 186 unchanged lines hidden --- |