{
/* Build the patch command and execute it. Ignore errors. Switch to
* cooked mode to allow the user to respond to prompts. */
- vim_snprintf((char *)buf, buflen, "patch -o %s %s < \"%s\"",
+ vim_snprintf((char *)buf, buflen,
+#ifdef UNIX
+ "patch -o %s %s < '%s'",
+#else
+ "patch -o %s %s < \"%s\"",
+#endif
tmp_new, tmp_orig,
# ifdef UNIX
fullname != NULL ? fullname :
bwipe!
new
call assert_fails('diffpatch Xpatch', 'E816:')
- call setline(1, ['1', '2', '3'])
- diffpatch Xpatch
- call assert_equal(['1', '2x', '3', '4'], getline(1, '$'))
+
+ for name in ['Xpatch', 'Xpatch$HOME']
+ call setline(1, ['1', '2', '3'])
+ if name != 'Xpatch'
+ call rename('Xpatch', name)
+ endif
+ exe 'diffpatch ' . escape(name, '$')
+ call assert_equal(['1', '2x', '3', '4'], getline(1, '$'))
+ if name != 'Xpatch'
+ call rename(name, 'Xpatch')
+ endif
+ bwipe!
+ endfor
+
call delete('Xpatch')
bwipe!
endfunc