Page MenuHomeFreeBSD

diff: Tweak range of -C and -U arguments
ClosedPublic

Authored by des on Thu, Feb 12, 1:55 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Feb 17, 6:23 AM
Unknown Object (File)
Sat, Feb 14, 10:35 PM
Unknown Object (File)
Sat, Feb 14, 6:46 PM
Unknown Object (File)
Sat, Feb 14, 7:30 AM
Unknown Object (File)
Fri, Feb 13, 12:17 PM
Unknown Object (File)
Fri, Feb 13, 12:15 PM
Unknown Object (File)
Fri, Feb 13, 9:11 AM
Unknown Object (File)
Fri, Feb 13, 5:23 AM
Subscribers

Details

Summary

POSIX uses the terms “positive decimal integer” for -C and “non-negative
decimal integer” for -U, which translates into lower bounds of 1 for -C
and 0 for -U.

POSIX does not specify a minimum upper bound for either mode, but as of
5fc739eb5949 both our backends support context sizes up to and including
INT_MAX, so use that.

Having had the opportunity to consult the Unix System Test Suite, the
diff test cases found therein happen to precisely match these bounds.

Switch fully to using strtonum() to parse numerical arguments, and try
to be more consistent in how we report usage errors.

MFC after: 1 week
Sponsored by: Klara, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 70643
Build 67526: arc lint + arc unit

Event Timeline

des requested review of this revision.Thu, Feb 12, 1:55 PM
This revision is now accepted and ready to land.Thu, Feb 12, 2:13 PM

more comprehensive tests

This revision now requires review to proceed.Thu, Feb 12, 2:25 PM
This revision is now accepted and ready to land.Fri, Feb 13, 8:12 PM
This revision was automatically updated to reflect the committed changes.