Conversation
`atinit'!...'` defers the hook, and the `!' has to be stripped before the body
is evaluated. Two branches strip it and each had its own defect.
The nocd branch of the source path stripped `1' instead of `!':
eval "${ICE[atinit]#1}"
so the body ran as a command named `!typeset', reported by #445.
The command branch put the strip inside the subscript:
eval "${ICE[atinit#!]}"
which looks up an ICE key named `atinit#!', finds nothing, and evaluates the
empty string. That one is silent: no error, no hook, and the load reports
success. It was not in the report and affects `as"command"' plug-ins without
nocd, which is the ordinary case for that branch.
Reproduced against the previous source:
CASE as-command atinit-bang: MARK_CMD=unset (no diagnostic at all)
CASE normal+nocd atinit-bang: MARK_NORM=unset ((eval):1: command not found: !typeset)
Both now read ${ICE[atinit]#!}, matching the other two sites.
tests/atinit-deferred-marker.zsh loads an `as"command"' plug-in without nocd and
a normal plug-in with nocd, each with a deferred atinit that sets a marker, and
asserts both markers. Each defect was reintroduced separately and the matching
assertion observed failing.
Closes #445
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the reported defect and a second one of the same kind, found next to it.
Two branches, two defects
atinit'!...'defers the hook, and the!has to be stripped before the body is evaluated. Two branches strip it, and each was wrong in a different way.The nocd branch of the source path, reported in #445, stripped
1instead of!:The body then ran as a command named
!typeset.The command branch put the strip inside the subscript:
That looks up an ICE key named
atinit#!, finds nothing, and evaluates the empty string:This one is silent: no error, no hook, and the load reports success. It was not in the report, and it affects
as"command"plug-ins without nocd, which is the ordinary case for that branch.Reproduced
Both sites now read
${ICE[atinit]#!}, matching the two other strips in the file.Test
tests/atinit-deferred-marker.zshloads anas"command"plug-in without nocd and a normal plug-in with nocd, each with a deferred atinit that sets a marker, then asserts both markers.Each defect was reintroduced separately and the matching assertion observed failing:
Registered in
zsh-n.yml, both path filters and a job. Full suite 24/24.Note on impact
The silent branch is the more serious of the two. A configuration relying on a deferred
atinithook in anas"command"plug-in has been quietly skipping it, with the load reporting success, so the failure surfaces later as unexplained missing state rather than as an error at load time.Closes #445