From 8cd720d608ef06db0a23da1c05845147c2839e29 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 16 Jul 2011 12:03:14 +0000 Subject: [PATCH] Mostly cosmetic change: don't claim to have found an SSH agent if SSH_AUTH_SOCK is defined to the empty string. (Because a common way to 'unset' it is to run commands like 'SSH_AUTH_SOCK= putty -load thing'.) [originally from svn r9225] --- unix/uxagentc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/unix/uxagentc.c b/unix/uxagentc.c index 3605c601..9f579cd9 100644 --- a/unix/uxagentc.c +++ b/unix/uxagentc.c @@ -17,7 +17,8 @@ int agent_exists(void) { - if (getenv("SSH_AUTH_SOCK") != NULL) + const char *p = getenv("SSH_AUTH_SOCK"); + if (p && *p) return TRUE; return FALSE; }