diff src/dired-msw.c @ 622:11502791fc1c

[xemacs-hg @ 2001-06-22 01:49:57 by ben] dired-msw.c: Fix problem noted by Michael Sperber with directories containing [] and code that destructively modifies an existing string. term\AT386.el: Fix warnings. term\apollo.el: Removed. Kill kill kill. Sync with FSF and remove most crap. term\linux.el: Removed. Sync with FSF. Don't define most defns, because they are automatically defined by termcap. But do add defns for keys that normally get defined as f13, f14, etc. and really ought to be shift-f3, shift-f4, etc. (NOTE: I did this based on Cygwin, which emulates the Linux console. I would appreciate it if someone on Linux could verify.) term\cygwin.el: New. Load term/linux. term\lk201.el, term\news.el, term\vt100.el: Sync with FSF. Fix warnings. dialog-gtk.el: Fix warning. For 21.4: help.el, update-elc.el: Compile in proper order. Maybe for 21.4: keydefs.el: Add a defn for M-?, previously undefined, to access help -- in case the terminal is not set up right, or f1 gets redefined. README: Rewrite.
author ben
date Fri, 22 Jun 2001 01:50:04 +0000
parents 183866b06e0b
children 943eaba38521
line wrap: on
line diff
--- a/src/dired-msw.c	Tue Jun 19 07:00:10 2001 +0000
+++ b/src/dired-msw.c	Fri Jun 22 01:50:04 2001 +0000
@@ -420,9 +420,8 @@
        (file, switches, wildcard, full_directory_p))
 {
   Lisp_Object		result, handler, wildpat, fns, basename;
-  char			*filename;
   char			*switchstr;
-  int			len, nfiles, i;
+  int			nfiles, i;
   int			hide_system, hide_dot, reverse, display_size;
   WIN32_FIND_DATA	*files, **sorted_files;
   enum mswindows_sortby	sort_by;
@@ -487,28 +486,11 @@
 	    }
 	}
 
-      /*
-       * Sometimes we get ".../foo* /" as FILE (without the space).
-       * While the shell and `ls' don't mind, we certainly do,
-       * because it makes us think there is no wildcard, only a
-       * directory name.
-       */
-      if (!NILP(Fstring_match(build_string("[[?*]"), file, Qnil, Qnil)))
-	{
-	  wildcard = Qt;
-	  filename = XSTRING_DATA(file);
-	  len = strlen(filename);
-	  if (len > 0 && (filename[len - 1] == '\\' ||
-			  filename[len - 1] == '/'))
-	    {
-	      filename[len - 1] = '\0';
-	    }
-	  file = build_string(filename);
-	}
       if (!NILP(wildcard))
 	{
 	  Lisp_Object	newfile;
 
+	  file = Fdirectory_file_name (file);
 	  basename = Ffile_name_nondirectory(file);
 	  fns = intern("wildcard-to-regexp");
 	  wildpat = call1(fns, basename);