getopts - OptArg length limit is 255 characters (shortstring)
Original Reporter info from Mantis: Bill_Stewart
-
Reporter name: Bill Stewart
Original Reporter info from Mantis: Bill_Stewart
- Reporter name: Bill Stewart
Description:
OptArg (option argument variable) is shortstring and limited to 255 characters.
Steps to reproduce:
Run below program and specify -a option with an argument that has length > 255 characters. Program outputs "OptArg length = 255".
{$MODE OBJFPC}
{$H+}
program test_getopts;
uses
getopts;
var
opt: char;
begin
repeat
opt := GetOpt('a:');
if opt = 'a' then
WriteLn('OptArg length = ', Length(OptArg));
until opt = EndOfOptions;
end.
Mantis conversion info:
- Mantis ID: 36892
- Version: 3.0.4
- Fixed in version: 3.3.1
- Fixed in revision: 44664 (#a678192c)
- Target version: 4.0.0