scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | README | LICENSE

commit 5bb6d19f73d6504a46ed55e16f357ade07e709f3
parent 59402b0a9be9b9ead0fa86bc90b24701cae4e87b
Author: Quentin Rameau <quinq@fifth.space>
Date:   Thu, 10 Jan 2019 17:10:33 +0100

[ar] Print usage on mutually exclusive options

Diffstat:
Msrc/cmd/ar.c | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/cmd/ar.c b/src/cmd/ar.c @@ -617,7 +617,10 @@ main(int argc, char *argv[]) usage(); } ARGEND - if (nkey == 0 || nkey > 1 || pos > 1 || argc == 0) + if (nkey == 0 || nkey > 1 || pos > 1 || argc == 0 || + (aflag || bflag) && !(key == 'm' || key == 'r') || + cflag && !(key == 'q' || key == 'r') || + uflag && key != 'r') usage(); signal(SIGINT, sigfun);