Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array elements not restored correctly after pre-command re-assignment #6

Open
okdana opened this issue Jul 2, 2018 · 0 comments
Open
Labels
bug unacknowledged Reported but unacknowledged on the ML

Comments

@okdana
Copy link
Owner

okdana commented Jul 2, 2018

(workers/42238 [mentioned])

On 3 Jan 2018, at 18:03, dana <dana@xxxxxxx> wrote:

The way i had handled this in the _busybox function is:

_cmd_variant[${words[1]}]=busybox _normal

That way you can temporarily override what _pick_variant thinks the actual
variant is. This seems to work quite well, but i did feel some guilt about it,
since as you mention it's circumventing the interface.

I was playing with this some more to see if i could come up with a better way
and actually discovered a problem with the method i described: it is not a
temporary override. Apparently pre-command re-assignment of array members
doesn't work the same way it does with scalars — zsh doesn't put the value back
the way it was when it's done executing the command. I assume the same code is
involved here as with the issue i brought up in workers/42097....

I am not actually sure if it is related (workers/42097 = my #4), but maybe. Didn't look into it much.

@okdana okdana added bug unacknowledged Reported but unacknowledged on the ML labels Jul 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unacknowledged Reported but unacknowledged on the ML
Projects
None yet
Development

No branches or pull requests

1 participant