To: vim-dev@vim.org Subject: Patch 7.2a.002 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 7.2a.002 Problem: getbufvar(N, "") gets the dictionary of the current buffer instead of buffer N. Solution: Set curbuf before calling find_var_in_ht(). (Kana Natsuno) Files: src/eval.c *** ../vim-7.2a.001/src/eval.c Wed Jun 25 00:49:25 2008 --- src/eval.c Thu Jun 26 21:09:52 2008 *************** *** 10442,10458 **** if (buf != NULL && varname != NULL) { ! if (*varname == '&') /* buffer-local-option */ ! { ! /* set curbuf to be our buf, temporarily */ ! save_curbuf = curbuf; ! curbuf = buf; get_option_tv(&varname, rettv, TRUE); - - /* restore previous notion of curbuf */ - curbuf = save_curbuf; - } else { if (*varname == NUL) --- 10442,10453 ---- if (buf != NULL && varname != NULL) { ! /* set curbuf to be our buf, temporarily */ ! save_curbuf = curbuf; ! curbuf = buf; + if (*varname == '&') /* buffer-local-option */ get_option_tv(&varname, rettv, TRUE); else { if (*varname == NUL) *************** *** 10461,10470 **** * find_var_in_ht(). */ varname = (char_u *)"b:" + 2; /* look up the variable */ ! v = find_var_in_ht(&buf->b_vars.dv_hashtab, varname, FALSE); if (v != NULL) copy_tv(&v->di_tv, rettv); } } --emsg_off; --- 10456,10468 ---- * find_var_in_ht(). */ varname = (char_u *)"b:" + 2; /* look up the variable */ ! v = find_var_in_ht(&curbuf->b_vars.dv_hashtab, varname, FALSE); if (v != NULL) copy_tv(&v->di_tv, rettv); } + + /* restore previous notion of curbuf */ + curbuf = save_curbuf; } --emsg_off; *** ../vim-7.2a.001/src/version.c Thu Jun 26 22:12:36 2008 --- src/version.c Fri Jun 27 20:24:06 2008 *************** *** 678,679 **** --- 678,681 ---- { /* Add new patch number below this line */ + /**/ + 2, /**/ -- hundred-and-one symptoms of being an internet addict: 96. On Super Bowl Sunday, you followed the score by going to the Yahoo main page instead of turning on the TV. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ download, build and distribute -- http://www.A-A-P.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///