Mostly cosmetic change: don't claim to have found an SSH agent if
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sat, 16 Jul 2011 12:03:14 +0000 (12:03 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sat, 16 Jul 2011 12:03:14 +0000 (12:03 +0000)
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'.)

git-svn-id: svn://svn.tartarus.org/sgt/putty@9225 cda61777-01e9-0310-a592-d414129be87e

unix/uxagentc.c

index 3605c60..9f579cd 100644 (file)
@@ -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;
 }