Mercurial > vim
comparison src/vim9script.c @ 28596:daf785caecf2 v8.2.4822
patch 8.2.4822: setting ufunc to NULL twice
Commit: https://github.com/vim/vim/commit/af59e34f1bf214ec6f2d0304c1c5b11ecda25a83
Author: LemonBoy <thatlemon@gmail.com>
Date: Sun Apr 24 21:55:00 2022 +0100
patch 8.2.4822: setting ufunc to NULL twice
Problem: Setting ufunc to NULL twice.
Solution: Set ufunc to NULL in find_exported(). (closes https://github.com/vim/vim/issues/19275)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 24 Apr 2022 23:00:03 +0200 |
parents | 294771aab3ae |
children | 9a7a2908e1a8 |
comparison
equal
deleted
inserted
replaced
28595:a336c53b6ffb | 28596:daf785caecf2 |
---|---|
708 { | 708 { |
709 int idx = -1; | 709 int idx = -1; |
710 svar_T *sv; | 710 svar_T *sv; |
711 scriptitem_T *script = SCRIPT_ITEM(sid); | 711 scriptitem_T *script = SCRIPT_ITEM(sid); |
712 | 712 |
713 *ufunc = NULL; | |
714 | |
713 if (script->sn_import_autoload && script->sn_state == SN_STATE_NOT_LOADED) | 715 if (script->sn_import_autoload && script->sn_state == SN_STATE_NOT_LOADED) |
714 { | 716 { |
715 if (do_source(script->sn_name, FALSE, DOSO_NONE, NULL) == FAIL) | 717 if (do_source(script->sn_name, FALSE, DOSO_NONE, NULL) == FAIL) |
716 { | 718 { |
717 semsg(_(e_cant_open_file_str), script->sn_name); | 719 semsg(_(e_cant_open_file_str), script->sn_name); |
722 // Find name in "script". | 724 // Find name in "script". |
723 idx = get_script_item_idx(sid, name, 0, cctx, cstack); | 725 idx = get_script_item_idx(sid, name, 0, cctx, cstack); |
724 if (idx >= 0) | 726 if (idx >= 0) |
725 { | 727 { |
726 sv = ((svar_T *)script->sn_var_vals.ga_data) + idx; | 728 sv = ((svar_T *)script->sn_var_vals.ga_data) + idx; |
727 *ufunc = NULL; | |
728 if ((sv->sv_flags & SVFLAG_EXPORTED) == 0) | 729 if ((sv->sv_flags & SVFLAG_EXPORTED) == 0) |
729 { | 730 { |
730 if (verbose) | 731 if (verbose) |
731 semsg(_(e_item_not_exported_in_script_str), name); | 732 semsg(_(e_item_not_exported_in_script_str), name); |
732 return -1; | 733 return -1; |