You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current description for rc_yesno() in rc_config.3 manual page has an ambiguous or somewhat nonsense description. As currently described, rc_yesno will not return if value is not true, and will set EINVAL if "value" is not a false description. It also indicates it recognizes "on" as a possible value, and it does not.
This is not how rc_yesno() actually works.
The description should be changed as follows:
**** returns true if value is true, yes, y, or 1 (regardless of case), otherwise returns false. If value is not a valid representation of true or the values false, no, n, or 0 (regardless of case), then rc_yesno() returns false and errno is set to EINVAL.
Here is the output of test cases for rc_yesno() that should exemplify what the manual page should describe:
$ ./docbug
Test case [yes] ==> returns [true] / errno 0
Test case [YES] ==> returns [true] / errno 0
Test case [Yes] ==> returns [true] / errno 0
Test case [Y] ==> returns [true] / errno 0
Test case [Yup] ==> returns [false] / errno 22
Test case [1] ==> returns [true] / errno 0
Test case [true] ==> returns [true] / errno 0
Test case [TRUE] ==> returns [true] / errno 0
Test case [True] ==> returns [true] / errno 0
Test case [One] ==> returns [false] / errno 22
Test case [on] ==> returns [false] / errno 22
Test case [On] ==> returns [false] / errno 22
Test case [oN] ==> returns [false] / errno 22
Test case [no] ==> returns [false] / errno 0
Test case [NO] ==> returns [false] / errno 0
Test case [No] ==> returns [false] / errno 0
Test case [N] ==> returns [false] / errno 0
Test case [Nope] ==> returns [false] / errno 22
Test case [0] ==> returns [false] / errno 0
Test case [false] ==> returns [false] / errno 0
Test case [FALSE] ==> returns [false] / errno 0
Test case [False] ==> returns [false] / errno 0
Test case [off] ==> returns [false] / errno 22
Test case [This] ==> returns [false] / errno 22
Test case [Is] ==> returns [false] / errno 22
Test case [just] ==> returns [false] / errno 22
Test case [some] ==> returns [false] / errno 22
Test case [random] ==> returns [false] / errno 22
Test case [Junk] ==> returns [false] / errno 22
If it is desired to recognize on/off as values, then this is a bug in rc_yesno().
The following is the program that generates the output above:
The current description for rc_yesno() in rc_config.3 manual page has an ambiguous or somewhat nonsense description. As currently described, rc_yesno will not return if value is not true, and will set EINVAL if "value" is not a false description. It also indicates it recognizes "on" as a possible value, and it does not.
This is not how rc_yesno() actually works.
The description should be changed as follows:
Here is the output of test cases for rc_yesno() that should exemplify what the manual page should describe:
If it is desired to recognize on/off as values, then this is a bug in rc_yesno().
The following is the program that generates the output above:
The text was updated successfully, but these errors were encountered: