To: vim-dev@vim.org Subject: Patch 6.0.204 Fcc: outbox From: Bram Moolenaar MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.0.204 Problem: ":unlet" doesn't work for variables with curly braces. (Thomas Scott Urban) Solution: Handle variable names with curly braces properly. (Vince Negri) Files: src/eval.c *** ../vim60.203/src/eval.c Wed Feb 6 20:40:51 2002 --- src/eval.c Fri Feb 8 19:06:00 2002 *************** *** 1031,1051 **** char_u *arg = eap->arg; char_u *name_end; char_u cc; do { - name_end = skiptowhite(arg); - cc = *name_end; - *name_end = NUL; ! if (do_unlet(arg) == FAIL && !eap->forceit) { ! *name_end = cc; ! EMSG2(_("E108: No such variable: \"%s\""), arg); ! break; } ! *name_end = cc; arg = skipwhite(name_end); } while (*arg != NUL); } --- 1031,1080 ---- char_u *arg = eap->arg; char_u *name_end; char_u cc; + char_u *expr_start; + char_u *expr_end; do { ! /* Find the end of the name. */ ! name_end = find_name_end(arg, &expr_start, &expr_end); ! ! #ifdef FEAT_MAGIC_BRACES ! if (expr_start != NULL) { ! char_u *temp_string; ! ! temp_string = make_expanded_name(arg, expr_start, ! expr_end, name_end); ! if (temp_string == NULL) ! EMSG2(_(e_invarg2), arg); ! else ! { ! if (do_unlet(temp_string) == FAIL && !eap->forceit) ! { ! EMSG2(_("E108: No such variable: \"%s\""), temp_string); ! vim_free(temp_string); ! break; ! } ! vim_free(temp_string); ! } } + else + #endif + { + cc = *name_end; + *name_end = NUL; ! if (do_unlet(arg) == FAIL && !eap->forceit) ! { ! *name_end = cc; ! EMSG2(_("E108: No such variable: \"%s\""), arg); ! break; ! } ! ! *name_end = cc; ! } arg = skipwhite(name_end); } while (*arg != NUL); } *** ../vim60.203/src/version.c Fri Feb 8 10:30:44 2002 --- src/version.c Fri Feb 8 19:08:29 2002 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 204, /**/ -- "To whoever finds this note - I have been imprisoned by my father who wishes me to marry against my will. Please please please please come and rescue me. I am in the tall tower of Swamp Castle." SIR LAUNCELOT's eyes light up with holy inspiration. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net \\\ ((( Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim ))) \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///