diff src/fileio.c @ 5104:93cccad6a26b v7.3.1295

updated for version 7.3.1295 Problem: glob() and globpath() do not handle escaped special characters properly. Solution: Handle escaped characters differently. (Adnan Zafar)
author Bram Moolenaar <bram@vim.org>
date Wed, 03 Jul 2013 16:53:03 +0200
parents 3717d569027d
children 74d2f3188cd0
line wrap: on
line diff
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -10301,7 +10301,10 @@ file_pat_to_reg_pat(pat, pat_end, allow_
 		 * foo\,bar -> foo,bar
 		 * foo\ bar -> foo bar
 		 * Don't unescape \, * and others that are also special in a
-		 * regexp. */
+		 * regexp.
+		 * An escaped { must be unescaped since we use magic not
+		 * verymagic.
+		 */
 		if (*++p == '?'
 #ifdef BACKSLASH_IN_FILENAME
 			&& no_bslash
@@ -10309,7 +10312,8 @@ file_pat_to_reg_pat(pat, pat_end, allow_
 			)
 		    reg_pat[i++] = '?';
 		else
-		    if (*p == ',' || *p == '%' || *p == '#' || *p == ' ')
+		    if (*p == ',' || *p == '%' || *p == '#'
+						    || *p == ' ' || *p == '{')
 			reg_pat[i++] = *p;
 		    else
 		    {