comparison src/lread.c @ 9790:637b4664f7a5

Change explicit uses of the Unix directory separator '/' to uses of the macros IS_ANY_SEP, IS_DIRECTORY_SEP, IS_DEVICE_SEP, DIRECTORY_SEP, and DEVICE_SEP. (init_lread) [WINDOWSNT]: Disable warnings about directories in the load path not existing. (load): Test DOS_NT instead of MSDOS.
author Richard M. Stallman <rms@gnu.org>
date Tue, 01 Nov 1994 08:22:31 +0000
parents c1d477aec340
children e91d69642eab
comparison
equal deleted inserted replaced
9789:a1e6724db219 9790:637b4664f7a5
355 struct gcpro gcpro1; 355 struct gcpro gcpro1;
356 Lisp_Object found; 356 Lisp_Object found;
357 /* 1 means inhibit the message at the beginning. */ 357 /* 1 means inhibit the message at the beginning. */
358 int nomessage1 = 0; 358 int nomessage1 = 0;
359 Lisp_Object handler; 359 Lisp_Object handler;
360 #ifdef MSDOS 360 #ifdef DOS_NT
361 char *dosmode = "rt"; 361 char *dosmode = "rt";
362 #endif 362 #endif /* DOS_NT */
363 363
364 CHECK_STRING (str, 0); 364 CHECK_STRING (str, 0);
365 str = Fsubstitute_in_file_name (str); 365 str = Fsubstitute_in_file_name (str);
366 366
367 /* If file name is magic, call the handler. */ 367 /* If file name is magic, call the handler. */
393 ".elc", 4)) 393 ".elc", 4))
394 { 394 {
395 struct stat s1, s2; 395 struct stat s1, s2;
396 int result; 396 int result;
397 397
398 #ifdef MSDOS 398 #ifdef DOS_NT
399 dosmode = "rb"; 399 dosmode = "rb";
400 #endif 400 #endif /* DOS_NT */
401 stat ((char *)XSTRING (found)->data, &s1); 401 stat ((char *)XSTRING (found)->data, &s1);
402 XSTRING (found)->data[XSTRING (found)->size - 1] = 0; 402 XSTRING (found)->data[XSTRING (found)->size - 1] = 0;
403 result = stat ((char *)XSTRING (found)->data, &s2); 403 result = stat ((char *)XSTRING (found)->data, &s2);
404 if (result >= 0 && (unsigned) s1.st_mtime < (unsigned) s2.st_mtime) 404 if (result >= 0 && (unsigned) s1.st_mtime < (unsigned) s2.st_mtime)
405 { 405 {
410 nomessage1 = 1; 410 nomessage1 = 1;
411 } 411 }
412 XSTRING (found)->data[XSTRING (found)->size - 1] = 'c'; 412 XSTRING (found)->data[XSTRING (found)->size - 1] = 'c';
413 } 413 }
414 414
415 #ifdef MSDOS 415 #ifdef DOS_NT
416 close (fd); 416 close (fd);
417 stream = fopen ((char *) XSTRING (found)->data, dosmode); 417 stream = fopen ((char *) XSTRING (found)->data, dosmode);
418 #else 418 #else /* not DOS_NT */
419 stream = fdopen (fd, "r"); 419 stream = fdopen (fd, "r");
420 #endif 420 #endif /* not DOS_NT */
421 if (stream == 0) 421 if (stream == 0)
422 { 422 {
423 close (fd); 423 close (fd);
424 error ("Failure to create stdio stream for %s", XSTRING (str)->data); 424 error ("Failure to create stdio stream for %s", XSTRING (str)->data);
425 } 425 }
482 static int 482 static int
483 complete_filename_p (pathname) 483 complete_filename_p (pathname)
484 Lisp_Object pathname; 484 Lisp_Object pathname;
485 { 485 {
486 register unsigned char *s = XSTRING (pathname)->data; 486 register unsigned char *s = XSTRING (pathname)->data;
487 return (*s == '/' 487 return (IS_DIRECTORY_SEP (s[0])
488 || (XSTRING (pathname)->size > 2
489 && IS_DEVICE_SEP (s[1]) && IS_DIRECTORY_SEP (s[2]))
488 #ifdef ALTOS 490 #ifdef ALTOS
489 || *s == '@' 491 || *s == '@'
490 #endif 492 #endif
491 #ifdef VMS 493 #ifdef VMS
492 || index (s, ':') 494 || index (s, ':')
493 #endif /* VMS */ 495 #endif /* VMS */
494 #ifdef MSDOS /* MW, May 1993 */
495 || (s[0] != '\0' && s[1] == ':' && s[2] == '/')
496 #endif
497 ); 496 );
498 } 497 }
499 498
500 /* Search for a file whose name is STR, looking in directories 499 /* Search for a file whose name is STR, looking in directories
501 in the Lisp list PATH, and trying suffixes from SUFFIX. 500 in the Lisp list PATH, and trying suffixes from SUFFIX.
1910 } 1909 }
1911 else 1910 else
1912 Vload_path = decode_env_path (0, normal); 1911 Vload_path = decode_env_path (0, normal);
1913 #endif 1912 #endif
1914 1913
1914 #ifndef WINDOWSNT
1915 /* When Emacs is invoked over network shares on NT, PATH_LOADSEARCH is
1916 almost never correct, thereby causing a warning to be printed out that
1917 confuses users. Since PATH_LOADSEARCH is always overriden by the
1918 EMACSLOADPATH environment variable below, disable the warning on NT. */
1919
1915 /* Warn if dirs in the *standard* path don't exist. */ 1920 /* Warn if dirs in the *standard* path don't exist. */
1916 { 1921 {
1917 Lisp_Object path_tail; 1922 Lisp_Object path_tail;
1918 1923
1919 for (path_tail = Vload_path; 1924 for (path_tail = Vload_path;
1930 "Warning: Lisp directory `%s' does not exist.\n", 1935 "Warning: Lisp directory `%s' does not exist.\n",
1931 XSTRING (Fcar (path_tail))->data); 1936 XSTRING (Fcar (path_tail))->data);
1932 } 1937 }
1933 } 1938 }
1934 } 1939 }
1940 #endif /* WINDOWSNT */
1935 1941
1936 /* If the EMACSLOADPATH environment variable is set, use its value. 1942 /* If the EMACSLOADPATH environment variable is set, use its value.
1937 This doesn't apply if we're dumping. */ 1943 This doesn't apply if we're dumping. */
1938 if (NILP (Vpurify_flag) 1944 if (NILP (Vpurify_flag)
1939 && egetenv ("EMACSLOADPATH")) 1945 && egetenv ("EMACSLOADPATH"))