shithub: scc

Download patch

ref: d59f5ffaaee5f2e79b8dbf204564d78478d24c4c
parent: a1b2fae9965606c705ee7a31772a5267650f3629
author: Quentin Rameau <quinq@fifth.space>
date: Thu Jan 10 12:10:33 EST 2019

[ar] Print usage on mutually exclusive options

--- a/src/cmd/ar.c
+++ b/src/cmd/ar.c
@@ -617,7 +617,10 @@
 		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);