Deleted Added
full compact
setrunelocale.c (12022) setrunelocale.c (19964)
1/*-
2 * Copyright (c) 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Paul Borman at Krystal Technologies.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 64 unchanged lines hidden (view full) ---

73 _RuneLocale *rl;
74
75 if (!encoding)
76 return(EFAULT);
77
78 /*
79 * The "C" and "POSIX" locale are always here.
80 */
1/*-
2 * Copyright (c) 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Paul Borman at Krystal Technologies.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 64 unchanged lines hidden (view full) ---

73 _RuneLocale *rl;
74
75 if (!encoding)
76 return(EFAULT);
77
78 /*
79 * The "C" and "POSIX" locale are always here.
80 */
81 if (!*encoding || !strcmp(encoding, "C") || !strcmp(encoding, "POSIX")) {
81 if (!strcmp(encoding, "C") || !strcmp(encoding, "POSIX")) {
82 _CurrentRuneLocale = &_DefaultRuneLocale;
83 return(0);
84 }
85
82 _CurrentRuneLocale = &_DefaultRuneLocale;
83 return(0);
84 }
85
86 if (!_PathLocale && !(_PathLocale = getenv("PATH_LOCALE")))
87 _PathLocale = _PATH_LOCALE;
88
86 if (!_PathLocale)
87 return(EFAULT);
89 (void) strcpy(name, _PathLocale);
90 (void) strcat(name, "/");
91 (void) strcat(name, encoding);
92 (void) strcat(name, "/LC_CTYPE");
93
94 if ((fp = fopen(name, "r")) == NULL)
95 return(ENOENT);
96

--- 23 unchanged lines hidden ---
88 (void) strcpy(name, _PathLocale);
89 (void) strcat(name, "/");
90 (void) strcat(name, encoding);
91 (void) strcat(name, "/LC_CTYPE");
92
93 if ((fp = fopen(name, "r")) == NULL)
94 return(ENOENT);
95

--- 23 unchanged lines hidden ---