From 6903e761d5e0472b55b9fa7c15153fd0be0c1505 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 22 Nov 2014 16:30:29 +0000 Subject: [PATCH 1/3] Consistently use &def for %makefile_extra pieces. mkfiles.pl was giving a couple of annoying perl warnings, because some makefile_extra strings were never set by Recipe. We already have the &def function to convert undefs into "" for this reason, but weren't using it everywhere. Now I think we are. --- mkfiles.pl | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/mkfiles.pl b/mkfiles.pl index fa05472e..f4365198 100755 --- a/mkfiles.pl +++ b/mkfiles.pl @@ -461,7 +461,7 @@ if (defined $makefiles{'cygwin'}) { &splitline("RCFLAGS = \$(RCINC) --define WIN32=1 --define _WIN32=1 ". "--define WINVER=0x0400 ".(join " ", map {"-I$dirpfx$_"} @srcdirs))."\n". "\n". - $makefile_extra{'cygwin'}->{'vars'} . + &def($makefile_extra{'cygwin'}->{'vars'}) . "\n". ".SUFFIXES:\n". "\n"; @@ -491,7 +491,7 @@ if (defined $makefiles{'cygwin'}) { } } print "\n"; - print $makefile_extra{'cygwin'}->{'end'} if defined $makefile_extra{'cygwin'}->{'end'}; + print &def($makefile_extra{'cygwin'}->{'end'}); print "\nclean:\n". "\trm -f *.o *.exe *.res.o *.so *.map\n". "\n". @@ -540,7 +540,7 @@ if (defined $makefiles{'borland'}) { "BCB = \$(MAKEDIR)\\..\n". "!endif\n". "\n". - $makefile_extra{'borland'}->{'vars'} . + &def($makefile_extra{'borland'}->{'vars'}) . "\n". ".c.obj:\n". &splitline("\tbcc32 -w-aus -w-ccc -w-par -w-pia \$(COMPAT)". @@ -597,7 +597,7 @@ if (defined $makefiles{'borland'}) { } } print "\n"; - print $makefile_extra{'borland'}->{'end'} if defined $makefile_extra{'borland'}->{'end'}; + print &def($makefile_extra{'borland'}->{'end'}); print "\nclean:\n". "\t-del *.obj\n". "\t-del *.exe\n". @@ -639,7 +639,7 @@ if (defined $makefiles{'vc'}) { "RCFLAGS = ".(join " ", map {"-I$dirpfx$_"} @srcdirs). " -DWIN32 -D_WIN32 -DWINVER=0x0400\n". "\n". - $makefile_extra{'vc'}->{'vars'} . + &def($makefile_extra{'vc'}->{'vars'}) . "\n". "\n"; print &splitline("all:" . join "", map { " $_.exe" } &progrealnames("G:C")); @@ -680,7 +680,7 @@ if (defined $makefiles{'vc'}) { } } print "\n"; - print $makefile_extra{'vc'}->{'end'} if defined $makefile_extra{'vc'}->{'end'}; + print &def($makefile_extra{'vc'}->{'end'}); print "\nclean: tidy\n". "\t-del *.exe\n\n". "tidy:\n". @@ -1398,7 +1398,7 @@ if (defined $makefiles{'gtk'}) { print &splitline("\t\$(CC) \$(COMPAT) \$(CFLAGS) \$(XFLAGS) -c $d->{deps}->[0]\n"); } print "\n"; - print $makefile_extra{'gtk'}->{'end'}; + print &def($makefile_extra{'gtk'}->{'end'}); print "\nclean:\n". "\trm -f *.o". (join "", map { " $_" } &progrealnames("X:U")) . "\n"; print "\nFORCE:\n"; @@ -1561,7 +1561,7 @@ if (defined $makefiles{'am'}) { print "endif\n" if $type eq "X"; print "\n"; } - print $makefile_extra{'am'}->{'end'}; + print &def($makefile_extra{'am'}->{'end'}); select STDOUT; close OUT; } @@ -1592,7 +1592,7 @@ if (defined $makefiles{'lcc'}) { "\n". "# Get include directory for resource compiler\n". "\n". - $makefile_extra{'lcc'}->{'vars'} . + &def($makefile_extra{'lcc'}->{'vars'}) . "\n"; print &splitline("all:" . join "", map { " $_.exe" } &progrealnames("G:C")); print "\n\n"; @@ -1623,7 +1623,7 @@ if (defined $makefiles{'lcc'}) { } } print "\n"; - print $makefile_extra{'lcc'}->{'end'} if defined $makefile_extra{'lcc'}->{'end'}; + print &def($makefile_extra{'lcc'}->{'end'}); print "\nclean:\n". "\t-del *.obj\n". "\t-del *.exe\n". @@ -1654,7 +1654,7 @@ if (defined $makefiles{'osx'}) { "MLDFLAGS = -framework Cocoa\n". "ULDFLAGS =\n". "\n" . - $makefile_extra{'osx'}->{'vars'} . + &def($makefile_extra{'osx'}->{'vars'}) . "\n" . &splitline("all:" . join "", map { " $_" } &progrealnames("MX:U")) . "\n"; From 91645175f79944c95a4b0fa194357a2be4ee4919 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 22 Nov 2014 16:35:54 +0000 Subject: [PATCH 2/3] Another missing initialisation. This one spotted in the old-fashioned way, by actually attempting a Plink raw connection and wondering why it didn't seem to be reading from standard input! Turns out 'bufsize' is uninitialised until the first send, which can inhibit any stdin reading if it gets a large enough nonsense value. --- raw.c | 1 + 1 file changed, 1 insertion(+) diff --git a/raw.c b/raw.c index a7fbbc5c..97355e8a 100644 --- a/raw.c +++ b/raw.c @@ -146,6 +146,7 @@ static const char *raw_init(void *frontend_handle, void **backend_handle, raw->closed_on_socket_error = FALSE; *backend_handle = raw; raw->sent_console_eof = raw->sent_socket_eof = FALSE; + raw->bufsize = 0; raw->frontend = frontend_handle; From 8c09f85a64ff31d05f37304a041fd766507a19f0 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 22 Nov 2014 16:38:01 +0000 Subject: [PATCH 3/3] Stop referring to Plink as "PuTTY Link". I don't think anyone has ever actually called it that, colloquially _or_ formally, and if anyone ever did (in a bug report, say) I'd probably have to stop and think to work out what they meant. It's universally called Plink, and should be officially so as well :-) --- doc/plink.but | 8 ++++---- unix/uxplink.c | 2 +- windows/winplink.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/plink.but b/doc/plink.but index 67d789ac..b09cd192 100644 --- a/doc/plink.but +++ b/doc/plink.but @@ -1,8 +1,8 @@ \C{plink} Using the command-line connection tool \i{Plink} -\i{Plink} (PuTTY Link) is a command-line connection tool similar to -UNIX \c{ssh}. It is mostly used for \i{automated operations}, such as -making CVS access a repository on a remote server. +\i{Plink} is a command-line connection tool similar to UNIX \c{ssh}. +It is mostly used for \i{automated operations}, such as making CVS +access a repository on a remote server. Plink is probably not what you want if you want to run an \i{interactive session} in a console window. @@ -40,7 +40,7 @@ version of Plink you're using, and gives you a brief summary of how to use Plink: \c Z:\sysosd>plink -\c PuTTY Link: command-line connection utility +\c Plink: command-line connection utility \c Release 0.XX \c Usage: plink [options] [user@]host [command] \c ("host" can also be a PuTTY saved session name) diff --git a/unix/uxplink.c b/unix/uxplink.c index 3901ba97..ab06eb77 100644 --- a/unix/uxplink.c +++ b/unix/uxplink.c @@ -542,7 +542,7 @@ void uxsel_input_remove(int id) { } */ static void usage(void) { - printf("PuTTY Link: command-line connection utility\n"); + printf("Plink: command-line connection utility\n"); printf("%s\n", ver); printf("Usage: plink [options] [user@]host [command]\n"); printf(" (\"host\" can also be a PuTTY saved session name)\n"); diff --git a/windows/winplink.c b/windows/winplink.c index 43826622..188d89bb 100644 --- a/windows/winplink.c +++ b/windows/winplink.c @@ -172,7 +172,7 @@ void agent_schedule_callback(void (*callback)(void *, void *, int), */ static void usage(void) { - printf("PuTTY Link: command-line connection utility\n"); + printf("Plink: command-line connection utility\n"); printf("%s\n", ver); printf("Usage: plink [options] [user@]host [command]\n"); printf(" (\"host\" can also be a PuTTY saved session name)\n");