X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=rsh.c;h=04cbdf7a67e9f26d024da1117bf5a5a03596dd1b;hb=e1ccf53a60657930ae7892387736c8b6a91ec610;hp=bcb1c80d84b77e04bf843c2b38592284760ae165;hpb=e8c80638abc99928dba9ac832589749a531e2e21;p=git.git diff --git a/rsh.c b/rsh.c index bcb1c80d..04cbdf7a 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