From c7c81b3a51de2778535c8bb18d42a4bb7dfd57bc Mon Sep 17 00:00:00 2001 From: Jason Riedy Date: Tue, 23 Aug 2005 13:34:07 -0700 Subject: Fix ?: statements. Omitting the first branch in ?: is a GNU extension. Cute, but not supported by other compilers. Replaced mostly by explicit tests. Calls to getenv() simply are repeated on non-GNU compilers. Signed-off-by: Jason Riedy --- rsh.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'rsh.c') diff --git a/rsh.c b/rsh.c index bcb1c80d8..04cbdf7a6 100644 --- a/rsh.c +++ b/rsh.c @@ -56,8 +56,10 @@ int setup_connection(int *fd_in, int *fd_out, const char *remote_prog, return error("Couldn't create socket"); } if (!fork()) { - const char *ssh = getenv("GIT_SSH") ? : "ssh"; - const char *ssh_basename = strrchr(ssh, '/'); + const char *ssh, *ssh_basename; + ssh = getenv("GIT_SSH"); + if (!ssh) ssh = "ssh"; + ssh_basename = strrchr(ssh, '/'); if (!ssh_basename) ssh_basename = ssh; else -- cgit v1.2.1