changeset 15626:a973e9f3f6d1

(file_name_completion): Set `stat' flags to avoid computing expensive fields in struct stat (makes filename completion much faster).
author Karl Heuer <kwzh@gnu.org>
date Sun, 07 Jul 1996 22:37:17 +0000
parents 537b4cdf9eff
children c5c4d478c78d
files src/dired.c
diffstat 1 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/dired.c	Sun Jul 07 22:36:38 1996 +0000
+++ b/src/dired.c	Sun Jul 07 22:37:17 1996 +0000
@@ -295,6 +295,19 @@
   int count = specpdl_ptr - specpdl;
   struct gcpro gcpro1, gcpro2, gcpro3;
 
+#ifdef MSDOS
+#if __DJGPP__ > 1
+  /* Some fields of struct stat are *very* expensive to compute on MS-DOS,
+     but aren't required here.  Avoid computing the following fields:
+     st_inode, st_size and st_nlink for directories, and the execute bits
+     in st_mode for non-directory files with non-standard extensions.  */
+
+  unsigned short save_djstat_flags = _djstat_flags;
+
+  _djstat_flags = _STAT_INODE | _STAT_EXEC_MAGIC | _STAT_DIRSIZE;
+#endif
+#endif
+
 #ifdef VMS
   extern DIRENTRY * readdirver ();
 
@@ -496,6 +509,12 @@
   UNGCPRO;
   bestmatch = unbind_to (count, bestmatch);
 
+#ifdef MSDOS
+#if __DJGPP__ > 1
+  _djstat_flags = save_djstat_flags;
+#endif
+#endif
+
   if (all_flag || NILP (bestmatch))
     return bestmatch;
   if (matchcount == 1 && bestmatchsize == XSTRING (file)->size)