aboutsummaryrefslogtreecommitdiffstats
path: root/src/lread.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lread.c')
-rw-r--r--src/lread.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lread.c b/src/lread.c
index dbbde694cf6..6d4c0d990af 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1449,7 +1449,6 @@ openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes, Lisp_Object *sto
1449 bool absolute = 0; 1449 bool absolute = 0;
1450 ptrdiff_t want_length; 1450 ptrdiff_t want_length;
1451 Lisp_Object filename; 1451 Lisp_Object filename;
1452 struct stat st;
1453 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6; 1452 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6;
1454 Lisp_Object string, tail, encoded_fn; 1453 Lisp_Object string, tail, encoded_fn;
1455 ptrdiff_t max_suffix_len = 0; 1454 ptrdiff_t max_suffix_len = 0;
@@ -1543,11 +1542,18 @@ openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes, Lisp_Object *sto
1543 } 1542 }
1544 else 1543 else
1545 { 1544 {
1545#ifndef WINDOWSNT
1546 struct stat st;
1547#endif
1546 const char *pfn; 1548 const char *pfn;
1547 1549
1548 encoded_fn = ENCODE_FILE (string); 1550 encoded_fn = ENCODE_FILE (string);
1549 pfn = SSDATA (encoded_fn); 1551 pfn = SSDATA (encoded_fn);
1552#ifdef WINDOWSNT
1553 exists = access (pfn, F_OK) == 0 && access (pfn, D_OK) < 0;
1554#else
1550 exists = (stat (pfn, &st) == 0 && ! S_ISDIR (st.st_mode)); 1555 exists = (stat (pfn, &st) == 0 && ! S_ISDIR (st.st_mode));
1556#endif
1551 if (exists) 1557 if (exists)
1552 { 1558 {
1553 /* Check that we can access or open it. */ 1559 /* Check that we can access or open it. */