changeset 1738:4f13df974cf4

Avoid gnu extension conditional operator
author Matt Johnston <matt@ucc.asn.au>
date Thu, 08 Oct 2020 11:00:04 +0800
parents 8b27de2c92ee
children 13d834efc376 a6824c54962a
files svr-chansession.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
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 */