+function! pathogen#is_absolute(path) abort
+ return a:path =~# (has('win32') ? '^\%([\\/]\|\w:\)[\\/]\|^[~$]' : '^[/~$]')
+endfunction
+
+" Given a string, returns all possible permutations of comma delimited braced
+" alternatives of that string. pathogen#expand('/{a,b}/{c,d}') yields
+" ['/a/c', '/a/d', '/b/c', '/b/d']. Empty braces are treated as a wildcard
+" and globbed. Actual globs are preserved.
+function! pathogen#expand(pattern) abort
+ if a:pattern =~# '{[^{}]\+}'
+ let [pre, pat, post] = split(substitute(a:pattern, '\(.\{-\}\){\([^{}]\+\)}\(.*\)', "\\1\001\\2\001\\3", ''), "\001", 1)
+ let found = map(split(pat, ',', 1), 'pre.v:val.post')
+ let results = []
+ for pattern in found
+ call extend(results, pathogen#expand(pattern))
+ endfor
+ return results
+ elseif a:pattern =~# '{}'
+ let pat = matchstr(a:pattern, '^.*{}[^*]*\%($\|[\\/]\)')
+ let post = a:pattern[strlen(pat) : -1]
+ return map(split(glob(substitute(pat, '{}', '*', 'g')), "\n"), 'v:val.post')
+ else
+ return [a:pattern]
+ endif
+endfunction
+