mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-01 21:21:15 -03:00
Saturate return value in builtin_set_query
builtin_set_query returns the number of missing variables. Because the return value passed to the shell is an 8-bit unsigned integer, if the number of missing variables is a multiple of 256, it would overflow to 0. This commit saturates the return value at 255 if there are more than 255 missing variables.
This commit is contained in:
committed by
Fabian Homborg
parent
42c75111c8
commit
6dd6a57c60
@@ -49,7 +49,7 @@ The following options are available:
|
||||
|
||||
- ``-e`` or ``--erase`` causes the specified shell variables to be erased
|
||||
|
||||
- ``-q`` or ``--query`` test if the specified variable names are defined. Does not output anything, but the builtins exit status is the number of variables specified that were not defined.
|
||||
- ``-q`` or ``--query`` test if the specified variable names are defined. Does not output anything, but the builtins exit status is the number of variables specified that were not defined, saturating at 255 if more than 255 variables are not defined.
|
||||
|
||||
- ``-n`` or ``--names`` List only the names of all defined variables, not their value. The names are guaranteed to be sorted.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user