comparison src/msdos.c @ 83114:0c11f1f77626

Merged in changes from CVS trunk. Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-256 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-257 {arch}/=cvs-sync-make-log: Use new features of tla-changelogs-to-log git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-154
author Karoly Lorentey <lorentey@elte.hu>
date Wed, 28 Apr 2004 14:10:58 +0000
parents 1029206e72f2 dabd7326e596
children 46882e012e30
comparison
equal deleted inserted replaced
83113:1a68e4b22355 83114:0c11f1f77626
4406 will break on DOS/Windows. Refuse to work if we cannot find 4406 will break on DOS/Windows. Refuse to work if we cannot find
4407 a directory, not even "c:/", usable for that purpose. */ 4407 a directory, not even "c:/", usable for that purpose. */
4408 for (i = 0; i < imax ; i++) 4408 for (i = 0; i < imax ; i++)
4409 { 4409 {
4410 const char *tmp = tempdirs[i]; 4410 const char *tmp = tempdirs[i];
4411 char buf[FILENAME_MAX];
4411 4412
4412 if (*tmp == '$') 4413 if (*tmp == '$')
4413 tmp = getenv (tmp + 1); 4414 {
4415 int tmp_len;
4416
4417 tmp = getenv (tmp + 1);
4418 if (!tmp)
4419 continue;
4420
4421 /* Some lusers set TMPDIR=e:, probably because some losing
4422 programs cannot handle multiple slashes if they use e:/.
4423 e: fails in `access' below, so we interpret e: as e:/. */
4424 tmp_len = strlen(tmp);
4425 if (tmp[tmp_len - 1] != '/' && tmp[tmp_len - 1] != '\\')
4426 {
4427 strcpy(buf, tmp);
4428 buf[tmp_len++] = '/', buf[tmp_len] = 0;
4429 tmp = buf;
4430 }
4431 }
4432
4414 /* Note that `access' can lie to us if the directory resides on a 4433 /* Note that `access' can lie to us if the directory resides on a
4415 read-only filesystem, like CD-ROM or a write-protected floppy. 4434 read-only filesystem, like CD-ROM or a write-protected floppy.
4416 The only way to be really sure is to actually create a file and 4435 The only way to be really sure is to actually create a file and
4417 see if it succeeds. But I think that's too much to ask. */ 4436 see if it succeeds. But I think that's too much to ask. */
4418 if (tmp && access (tmp, D_OK) == 0) 4437 if (tmp && access (tmp, D_OK) == 0)