This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".
The branch, master has been updated
via 383dbd669b7c7cb46ff83b6eba30da8a0be41ada (commit)
from 69a8622c614be88cbbb8552fd6a2a92384e8fc22 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=383dbd669b7c7cb46ff83b6eba30da8a0be41ada
commit 383dbd669b7c7cb46ff83b6eba30da8a0be41ada
Author: Mats Erik Andersson <[email protected]>
Date: Sat Mar 3 23:49:28 2012 +0100
tftp: Silence prompt for non-interactive.
diff --git a/ChangeLog b/ChangeLog
index 55949bc..b30632f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-03-03 Mats Erik Andersson <[email protected]>
+
+ Display command prompt only in interactive mode.
+ * src/tftp.c (fromatty): New variable; true in interactive mode.
+ (main): Assign value to FROMATTY.
+ (command): Display prompt only if FROMATTY is true.
+
2012-03-02 Mats Erik Andersson <[email protected]>
Make service lookup optional in FTP client.
diff --git a/src/tftp.c b/src/tftp.c
index d191b03..d85c14a 100644
--- a/src/tftp.c
+++ b/src/tftp.c
@@ -109,6 +109,7 @@ static int port; /* Port number in host byte order of the
server. */
static int trace;
static int verbose;
static int connected;
+static int fromatty;
char mode[32];
char line[200];
@@ -270,6 +271,8 @@ main (int argc, char *argv[])
else
port = ntohs (sp->s_port);
+ fromatty = isatty (STDIN_FILENO);
+
strcpy (mode, "netascii");
signal (SIGINT, intr);
if (hostport_argc > 1)
@@ -793,7 +796,8 @@ command (void)
for (;;)
{
- printf ("%s> ", prompt);
+ if (fromatty)
+ printf ("%s> ", prompt);
if (fgets (line, sizeof line, stdin) == 0)
{
if (feof (stdin))
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 7 +++++++
src/tftp.c | 6 +++++-
2 files changed, 12 insertions(+), 1 deletions(-)
hooks/post-receive
--
GNU Inetutils
_______________________________________________
Commit-inetutils mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/commit-inetutils