shithub: qk1

Download patch

ref: 96d6d5eb7809edca1f1ec91bd558e383827511ce
parent: 2eb95bc583ced3b65af6e6c7b07194737d428ed8
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Thu Dec 28 12:09:52 EST 2023

cdcmd: shorten

--- a/cd.c
+++ b/cd.c
@@ -9,6 +9,7 @@
 cdcmd(void)
 {
 	char *c;
+	bool loop;
 
 	if(Cmd_Argc() < 2){
 usage:
@@ -16,14 +17,10 @@
 		return;
 	}
 	c = Cmd_Argv(1);
-	if(cistrcmp(c, "play") == 0){
+	if((loop = cistrcmp(c, "loop") == 0) || cistrcmp(c, "play") == 0){
 		if(Cmd_Argc() < 3)
 			goto usage;
-		playcd(atoi(Cmd_Argv(2)), 0);
-	}else if(cistrcmp(c, "loop") == 0){
-		if(Cmd_Argc() < 3)
-			goto usage;
-		playcd(atoi(Cmd_Argv(2)), 1);
+		playcd(atoi(Cmd_Argv(2)), loop);
 	}else if(cistrcmp(c, "stop") == 0)
 		stopcd();
 	else if(cistrcmp(c, "pause") == 0)