++*argc;
while (*p != NUL && (inquote || (*p != ' ' && *p != TAB)))
{
- if (*p == '"')
+ if (p[0] == '"')
inquote = !inquote;
+ else if (p[0] == '\\' && p[1] != NUL)
+ {
+ /* First pass: skip over "\ " and "\"".
+ * Second pass: Remove the backslash. */
+ if (i == 1)
+ mch_memmove(p, p + 1, STRLEN(p));
+ else
+ ++p;
+ }
++p;
}
if (*p == NUL)
let size = term_getsize('')
bwipe!
call assert_equal([7, 27], size)
+
+ call delete('Xtext')
endfunc
func Test_terminal_curwin()
split dummy
bwipe!
-
+ call delete('Xtext')
endfunc
func Test_finish_open_close()
call assert_equal('look here', term_getline(buf, 1))
bwipe!
endfunc
+
+func Test_terminal_special_chars()
+ " this file name only works on Unix
+ if !has('unix')
+ return
+ endif
+ call mkdir('Xdir with spaces')
+ call writefile(['x'], 'Xdir with spaces/quoted"file')
+ term ls Xdir\ with\ spaces/quoted\"file
+ call WaitFor('term_getline("", 1) =~ "quoted"')
+ call assert_match('quoted"file', term_getline('', 1))
+ call term_wait('')
+
+ call delete('Xdir with spaces', 'rf')
+ bwipe
+endfunc