diff svr-chansession.c @ 1738:4f13df974cf4

Avoid gnu extension conditional operator
author Matt Johnston <matt@ucc.asn.au>
date Thu, 08 Oct 2020 11:00:04 +0800
parents 8a7d26e86a56
children 685b47d8faf7
line wrap: on
line diff
--- a/svr-chansession.c	Tue Jul 28 18:53:48 2020 +0800
+++ b/svr-chansession.c	Thu Oct 08 11:00:04 2020 +0800
@@ -693,7 +693,11 @@
 
 	/* take global command into account */
 	if (svr_opts.forced_command) {
-		chansess->original_command = chansess->cmd ? : m_strdup("");
+		if (chansess->cmd) {
+			chansess->original_command = chansess->cmd;
+		} else {
+			chansess->original_command = m_strdup("");
+		}
 		chansess->cmd = m_strdup(svr_opts.forced_command);
 	} else {
 		/* take public key option 'command' into account */