broken getopts misordering parameters when using permute flag
Original Reporter info from Mantis: nicotux
-
Reporter name:
Original Reporter info from Mantis: nicotux
- Reporter name:
Description:
Parse of commandlines parameters is still not working. Order and indexes of non option parameters are not correct when permure flag is set. This is a very old issue athat affect every versions and the patch is easy and was send many times. I send it once more
Steps to reproduce:
Simply take a look at any commandline tool with a little bit complex (anything will do) optionlist
Additional information:
Patch:
getopts.pp:476
-inc(optind)
+inc(optind);
+if ordering=permute then
+ if (first_nonopt<>last_nonopt) and (last_nonopt<>optind) then
+ exchange;
Now fpc becomes usable for usefull commandline tools ;) this is a major issue in that it make potential users say fpc does not work after 2 or 3 first tests and thus fail to use it
Mantis conversion info:
- Mantis ID: 19842
- OS: all
- OS Build: all
- Build: all
- Platform: all
- Version: 2.4.5
- Fixed in version: 3.3.1
- Fixed in revision: 40908 (#e69f4c1e)
- Target version: 3.2.0