gpg2/gnupg-2.0.4-default-tty.diff

24 lines
627 B
Diff

# sets default tty to /dev/tty
--- common/asshelp.c
+++ common/asshelp.c
@@ -95,6 +95,8 @@
dft_ttyname = getenv ("GPG_TTY");
if ((!dft_ttyname || !*dft_ttyname) && ttyname (0))
dft_ttyname = ttyname (0);
+ if (!dft_ttyname)
+ dft_ttyname = "/dev/tty";
}
if (opt_ttyname || dft_ttyname)
{
--- common/simple-pwquery.c
+++ common/simple-pwquery.c
@@ -222,6 +222,8 @@
#ifndef HAVE_W32_SYSTEM
if ((!dft_ttyname || !*dft_ttyname) && ttyname (0))
dft_ttyname = ttyname (0);
+ if (!dft_ttyname)
+ dft_ttyname = "/dev/tty";
#endif
if (dft_ttyname && *dft_ttyname)
{