Lines 12-17
Link Here
|
12 |
|
12 |
|
13 |
#include <time.h> |
13 |
#include <time.h> |
14 |
|
14 |
|
|
|
15 |
#ifdef UNIX |
16 |
# include <natspec.h> |
17 |
# include <locale.h> |
18 |
#endif |
19 |
|
15 |
#if defined(MINIX) || defined(__mpexl) |
20 |
#if defined(MINIX) || defined(__mpexl) |
16 |
# ifdef S_IWRITE |
21 |
# ifdef S_IWRITE |
17 |
# undef S_IWRITE |
22 |
# undef S_IWRITE |
Lines 58-63
Link Here
|
58 |
|
63 |
|
59 |
/* Local functions */ |
64 |
/* Local functions */ |
60 |
local char *readd OF((DIR *)); |
65 |
local char *readd OF((DIR *)); |
|
|
66 |
local const char *oem_charset = NULL; |
61 |
|
67 |
|
62 |
|
68 |
|
63 |
#ifdef NO_DIR /* for AT&T 3B1 */ |
69 |
#ifdef NO_DIR /* for AT&T 3B1 */ |
Lines 256-261
Link Here
|
256 |
if (!pathput) |
262 |
if (!pathput) |
257 |
t = last(t, PATH_END); |
263 |
t = last(t, PATH_END); |
258 |
|
264 |
|
|
|
265 |
#ifdef UNIX |
266 |
if (!oem_charset) { |
267 |
setlocale(LC_CTYPE, ""); |
268 |
oem_charset = natspec_get_charset_by_locale(NATSPEC_DOSCS, ""); |
269 |
} |
270 |
/* Convert to internal encoding */ |
271 |
if ((n = natspec_convert(t, oem_charset, 0, 0)) == NULL) |
272 |
return NULL; |
273 |
return n; |
274 |
#else |
259 |
/* Malloc space for internal name and copy it */ |
275 |
/* Malloc space for internal name and copy it */ |
260 |
if ((n = malloc(strlen(t) + 1)) == NULL) |
276 |
if ((n = malloc(strlen(t) + 1)) == NULL) |
261 |
return NULL; |
277 |
return NULL; |
Lines 263-268
Link Here
|
263 |
|
279 |
|
264 |
if (dosify) |
280 |
if (dosify) |
265 |
msname(n); |
281 |
msname(n); |
|
|
282 |
#endif |
266 |
|
283 |
|
267 |
#ifdef EBCDIC |
284 |
#ifdef EBCDIC |
268 |
strtoasc(n, n); /* here because msname() needs native coding */ |
285 |
strtoasc(n, n); /* here because msname() needs native coding */ |
Lines 283-290
Link Here
|
283 |
{ |
300 |
{ |
284 |
char *x; /* external file name */ |
301 |
char *x; /* external file name */ |
285 |
|
302 |
|
|
|
303 |
#ifdef UNIX |
304 |
if (!oem_charset) { |
305 |
oem_charset = natspec_get_charset_by_locale(NATSPEC_DOSCS, ""); |
306 |
setlocale(LC_CTYPE, ""); |
307 |
} |
308 |
/* Convert to internal encoding */ |
309 |
if ((x = natspec_convert(n, 0, oem_charset, 0)) == NULL) |
310 |
return NULL; |
311 |
return x; |
312 |
#else |
286 |
if ((x = malloc(strlen(n) + 1 + PAD)) == NULL) |
313 |
if ((x = malloc(strlen(n) + 1 + PAD)) == NULL) |
287 |
return NULL; |
314 |
return NULL; |
|
|
315 |
#endif |
288 |
#ifdef EBCDIC |
316 |
#ifdef EBCDIC |
289 |
strtoebc(x, n); |
317 |
strtoebc(x, n); |
290 |
#else |
318 |
#else |