From 0cf6f545ac227b02bb505adc2afad97a16555ae1 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <Bram@vim.org>
Date: Sun, 16 Jan 2005 21:59:36 +0000
Subject: [PATCH] updated for version 7.0040

---
 src/Make_ming.mak | 5 ++++-
 src/os_unix.c     | 7 ++++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/Make_ming.mak b/src/Make_ming.mak
index e6bf381d02..b90cf79fb0 100644
--- a/src/Make_ming.mak
+++ b/src/Make_ming.mak
@@ -223,15 +223,18 @@ ifeq ($(CROSS),yes)
 # cross-compiler:
 CC = i586-pc-mingw32msvc-gcc
 DEL = rm
+MKDIR = mkdir -p
 WINDRES = i586-pc-mingw32msvc-windres
 else
 # normal (Windows) compilation:
 CC = gcc
 ifneq (sh.exe, $(SHELL))
 DEL = rm
+MKDIR = mkdir -p
 DIRSLASH = /
 else
 DEL = del
+MKDIR = mkdir
 DIRSLASH = \\
 endif
 WINDRES = windres
@@ -547,7 +550,7 @@ $(OUTDIR)/vimrc.o: $(OUTDIR)/vimres.res
 	$(WINDRES) $(OUTDIR)/vimres.res $(OUTDIR)/vimrc.o
 
 $(OUTDIR):
-	mkdir -p $(OUTDIR)
+	$(MKDIR) $(OUTDIR)
 
 $(OUTDIR)/ex_docmd.o:	ex_docmd.c $(INCL) ex_cmds.h
 	$(CC) -c $(CFLAGS) ex_docmd.c -o $(OUTDIR)/ex_docmd.o
diff --git a/src/os_unix.c b/src/os_unix.c
index 6186d9264b..81fa4240c1 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -4939,7 +4939,12 @@ mch_expand_wildcards(num_pat, pat, num_file, file, flags)
 		    *p++ = '"';
 		}
 		else
-		    *p++ = pat[i][j++];
+		{
+		    /* For a backslash also copy the next character, don't
+		     * want to put quotes around it. */
+		    if ((*p++ = pat[i][j++]) == '\\' && pat[i][j] != NUL)
+			*p++ = pat[i][j++];
+		}
 	    *p = NUL;
 #endif
 	}
-- 
GitLab