Skip to content

Setting options (but not bufferSize) makes the default of bufferSize unset and produces an error #28

@ghost

Description

Due to checking only for the existence of an options object (on line 405), setting any option will make that check true. Thereafter, the only check related to bufferSize is if options.bufferSize ~= nil, which will be the case if we set another option, but not bufferSize. This means that if one uses parseLine with an options object, but doesn't set the bufferSize manually (since one wants to use the default value for that), one will get a very cryptic error message: bad argument #1 to 'read' (string expected, got nil), which requires quite a bit of scanning the code to find the origin of. This would be fixed if we had something like if options.bufferSize == nil then options.bufferSize = 2^16 end or similar in that block.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions