Mercurial > vim
comparison src/vim9script.c @ 29828:6b7020f3d856 v9.0.0253
patch 9.0.0253: a symlink to an autoload script results in two entries
Commit: https://github.com/vim/vim/commit/753885b6c5b9021184daa94d32fd8bf025f1b488
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Aug 24 16:30:36 2022 +0100
patch 9.0.0253: a symlink to an autoload script results in two entries
Problem: A symlink to an autoload script results in two entries in the list
of scripts, items expected in one are actually in the other.
Solution: Have one script item refer to the actually sourced one.
(closes #10960)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 24 Aug 2022 17:45:03 +0200 |
parents | 3fcd11b8c81a |
children | 328f91a31951 |
comparison
equal
deleted
inserted
replaced
29827:db296237ca1d | 29828:6b7020f3d856 |
---|---|
692 cmd_end = handle_import(eap->arg, NULL, current_sctx.sc_sid, | 692 cmd_end = handle_import(eap->arg, NULL, current_sctx.sc_sid, |
693 &evalarg, NULL); | 693 &evalarg, NULL); |
694 if (cmd_end != NULL) | 694 if (cmd_end != NULL) |
695 set_nextcmd(eap, cmd_end); | 695 set_nextcmd(eap, cmd_end); |
696 clear_evalarg(&evalarg, eap); | 696 clear_evalarg(&evalarg, eap); |
697 } | |
698 | |
699 /* | |
700 * When a script is a symlink it may be imported with one name and sourced | |
701 * under another name. Adjust the import script ID if needed. | |
702 * "*sid" must be a valid script ID. | |
703 */ | |
704 void | |
705 import_check_sourced_sid(int *sid) | |
706 { | |
707 scriptitem_T *script = SCRIPT_ITEM(*sid); | |
708 | |
709 if (script->sn_sourced_sid > 0) | |
710 *sid = script->sn_sourced_sid; | |
697 } | 711 } |
698 | 712 |
699 /* | 713 /* |
700 * Find an exported item in "sid" matching "name". | 714 * Find an exported item in "sid" matching "name". |
701 * Either "cctx" or "cstack" is NULL. | 715 * Either "cctx" or "cstack" is NULL. |