GetLongOpts won't set flag when long option is found
Original Reporter info from Mantis: grouchysmurf
-
Reporter name: grouchysmurf
Original Reporter info from Mantis: grouchysmurf
- Reporter name: grouchysmurf
Description:
GetLongOpts fails to set a flag even when directly told to so.
Consider the attached code.
When executed with '-o' it sets flag as expected. When one uses
'--option' instead flag is not set.
The bug MIGHT be caused by Exit() in getopts.pp, line #397:
if longind<>nil then
plongint(longind)^:=indfound+1;
if pfound^.flag<>nil then
begin
pfound^.flag^:=pfound^.value;
internal_getopt:=#0;
exit;
end;
Steps to reproduce:
Run the code.
Mantis conversion info:
- Mantis ID: 30736
- OS: Windows
- OS Build: 10
- Version: 3.0.0
- Fixed in version: 3.1.1
- Target version: 3.1.1