To: vim-dev@vim.org Subject: Patch 6.1.299 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.299 Problem: ":edit +set\ ro file" doesn't work. Solution: Halve the number of backslashes in the "+cmd" argument. Files: src/ex_docmd.c *** ../vim61.298/src/ex_docmd.c Sun Jan 5 22:14:46 2003 --- src/ex_docmd.c Wed Jan 15 22:48:27 2003 *************** *** 106,112 **** # define ex_buffer_all ex_ni #endif static char_u *getargcmd __ARGS((char_u **)); ! static char_u *skip_cmd_arg __ARGS((char_u *p)); static int getargopt __ARGS((exarg_T *eap)); #ifndef FEAT_QUICKFIX # define ex_make ex_ni --- 106,112 ---- # define ex_buffer_all ex_ni #endif static char_u *getargcmd __ARGS((char_u **)); ! static char_u *skip_cmd_arg __ARGS((char_u *p, int rembs)); static int getargopt __ARGS((exarg_T *eap)); #ifndef FEAT_QUICKFIX # define ex_make ex_ni *************** *** 2393,2399 **** { /* Check if we're in the +command */ p = arg + 1; ! arg = skip_cmd_arg(arg); /* Still touching the command after '+'? */ if (*arg == NUL) --- 2393,2399 ---- { /* Check if we're in the +command */ p = arg + 1; ! arg = skip_cmd_arg(arg, FALSE); /* Still touching the command after '+'? */ if (*arg == NUL) *************** *** 3490,3498 **** else { command = arg; ! arg = skip_cmd_arg(command); ! if (*arg) ! *arg++ = NUL; /* terminate command with NUL */ } arg = skipwhite(arg); /* skip over spaces */ --- 3490,3498 ---- else { command = arg; ! arg = skip_cmd_arg(command, TRUE); ! if (*arg != NUL) ! *arg++ = NUL; /* terminate command with NUL */ } arg = skipwhite(arg); /* skip over spaces */ *************** *** 3505,3518 **** * Find end of "+command" argument. Skip over "\ " and "\\". */ static char_u * ! skip_cmd_arg(p) char_u *p; { while (*p && !vim_isspace(*p)) { if (*p == '\\' && p[1] != NUL) ++p; - ++p; } return p; } --- 3505,3529 ---- * Find end of "+command" argument. Skip over "\ " and "\\". */ static char_u * ! skip_cmd_arg(p, rembs) char_u *p; + int rembs; /* TRUE to halve the number of backslashes */ { while (*p && !vim_isspace(*p)) { if (*p == '\\' && p[1] != NUL) + { + if (rembs) + mch_memmove(p, p + 1, STRLEN(p)); + else + ++p; + } + #ifdef FEAT_MBYTE + if (has_mbyte) + p += (*mb_ptr2len_check)(p); + else + #endif ++p; } return p; } *************** *** 3559,3565 **** ++arg; *pp = (int)(arg - eap->cmd); ! arg = skip_cmd_arg(arg); eap->arg = skipwhite(arg); *arg = NUL; --- 3570,3576 ---- ++arg; *pp = (int)(arg - eap->cmd); ! arg = skip_cmd_arg(arg, FALSE); eap->arg = skipwhite(arg); *arg = NUL; *** ../vim61.298/src/version.c Sun Jan 19 19:58:24 2003 --- src/version.c Sun Jan 19 20:04:46 2003 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 299, /**/ -- You have heard the saying that if you put a thousand monkeys in a room with a thousand typewriters and waited long enough, eventually you would have a room full of dead monkeys. (Scott Adams - The Dilbert principle) /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.Moolenaar.net \\\ /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///