- char *infostr = getenv ("GPG_AGENT_INFO");
-
- if (!infostr || !*infostr)
- infostr = make_filename (default_homedir (), "S.gpg-agent", NULL);
- else
- {
- char *tmp;
-
- infostr = xstrdup (infostr);
- tmp = strchr (infostr, PATHSEP_C);
- if (!tmp || tmp == infostr)
- {
- xfree (infostr);
- infostr = NULL;
- }
- else
- *tmp = 0;
- }
- es_fprintf (outfp, "agent-socket:%s\n",
- infostr? gc_percent_escape (infostr) : "");
- xfree (infostr);
+ char *tmp = make_filename (default_homedir (),
+ GPG_AGENT_SOCK_NAME, NULL);
+ es_fprintf (outfp, "agent-socket:%s\n", gc_percent_escape (tmp));
+ xfree (tmp);