comparison 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
comparison
equal deleted inserted replaced
5103:1fc08f2489e7 5104:93cccad6a26b
10299 * foo\?bar -> foo?bar 10299 * foo\?bar -> foo?bar
10300 * foo\%bar -> foo%bar 10300 * foo\%bar -> foo%bar
10301 * foo\,bar -> foo,bar 10301 * foo\,bar -> foo,bar
10302 * foo\ bar -> foo bar 10302 * foo\ bar -> foo bar
10303 * Don't unescape \, * and others that are also special in a 10303 * Don't unescape \, * and others that are also special in a
10304 * regexp. */ 10304 * regexp.
10305 * An escaped { must be unescaped since we use magic not
10306 * verymagic.
10307 */
10305 if (*++p == '?' 10308 if (*++p == '?'
10306 #ifdef BACKSLASH_IN_FILENAME 10309 #ifdef BACKSLASH_IN_FILENAME
10307 && no_bslash 10310 && no_bslash
10308 #endif 10311 #endif
10309 ) 10312 )
10310 reg_pat[i++] = '?'; 10313 reg_pat[i++] = '?';
10311 else 10314 else
10312 if (*p == ',' || *p == '%' || *p == '#' || *p == ' ') 10315 if (*p == ',' || *p == '%' || *p == '#'
10316 || *p == ' ' || *p == '{')
10313 reg_pat[i++] = *p; 10317 reg_pat[i++] = *p;
10314 else 10318 else
10315 { 10319 {
10316 if (allow_dirs != NULL && vim_ispathsep(*p) 10320 if (allow_dirs != NULL && vim_ispathsep(*p)
10317 #ifdef BACKSLASH_IN_FILENAME 10321 #ifdef BACKSLASH_IN_FILENAME