Stop including <gtk/gtkcontainer.h> directly, since a user points out
that it'll be absent in GTK 3.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9571 cda61777-01e9-0310-a592-d414129be87e
Turns out that the compose-keys fix in r9567 did in fact break one
piece of keyboard handling: if Num Lock is on, numeric keypad keys are
eaten by the IM, so we must avoid passing them to the IM in the first
place if we're in any non-default numeric keypad mode (application or
Nethack).

This is a grubby way to do it, but the more obvious approach of just
moving the Nethack and app-keypad if statements up to above the IM
call doesn't work because those statements depend on the generic
Alt-prefix handling that happens just _below_ the IM call. So instead
I just repeat the list of keystrokes and modes in an if statement
conditionalising the IM call.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9573 cda61777-01e9-0310-a592-d414129be87e
If pterm's execvp fails when given the whole argument list after -e,
and the argument list contains only one string, try again by passing
that single string to "$SHELL -c" to be parsed as a shell command.
This matches xterm's behaviour (as of xterm 261, at least), and means
in practice that users can do _either_ of 'pterm -e some command' and
'pterm -e "some command"'.

(A quick survey suggests that the majority of X terminal programs agree
with pterm's old behaviour of only supporting '-e some command',
except that gnome-terminal only supports the other behaviour and xterm
supports both. With that disagreement, I think supporting both is
probably the sensible thing.)


git-svn-id: svn://svn.tartarus.org/sgt/putty@9575 cda61777-01e9-0310-a592-d414129be87e
Remove term_key, which was intended to handle function keys in a cross-
platform manner, but which nothing ever called.  It thus served only to
trap up the unwary.  The live function key handling code lives in the
frontends, i.e. window.c on Windows and gtkwin.c on Unix.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9579 cda61777-01e9-0310-a592-d414129be87e
Rework the new type-check in sresize so that it doesn't cause a
compile warning ('left-hand operand of comma expression has no
effect'), which of course becomes fatal under -Werror.

(This would have been instantly noticeable to people compiling with
the old-fashioned Makefile.gtk, which does include -Wall -Werror, but
those of us using the new autoconf makefile hadn't noticed.)


git-svn-id: svn://svn.tartarus.org/sgt/putty@9582 cda61777-01e9-0310-a592-d414129be87e
Add '-Wall -Werror' to the compile options in the autotools makefile,
having just noticed that Makefile.gtk had it and this one doesn't. (Of
course, this being autoconf, we can easily enough make it conditional
on the compiler actually being gcc.)


git-svn-id: svn://svn.tartarus.org/sgt/putty@9583 cda61777-01e9-0310-a592-d414129be87e
Remove a bashism in mksrcarc.sh, without which bob builds fail on
Ubuntu (whose /bin/sh is not bash).


git-svn-id: svn://svn.tartarus.org/sgt/putty@9585 cda61777-01e9-0310-a592-d414129be87e
Introduce a new utility function smemclr(), which memsets things to
zero but does it in such a way that over-clever compilers hopefully
won't helpfully optimise the call away if you do it just before
freeing something or letting it go out of scope. Use this for
(hopefully) every memset whose job is to destroy sensitive data that
might otherwise be left lying around in the process's memory.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9586 cda61777-01e9-0310-a592-d414129be87e
Remove an unused variable.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9589 cda61777-01e9-0310-a592-d414129be87e
Move the declaration of smemclr() out of putty.h into misc.h, because
one of its uses (in sshaes.c) wasn't picking up the former. Thanks to
Ubuntu's gcc for spotting that.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9590 cda61777-01e9-0310-a592-d414129be87e
Fix an embarrassing mistake in config box handling which was causing
changes to any SSH bug config option to be lost when the config box
switched to a different panel, at least on GTK.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9591 cda61777-01e9-0310-a592-d414129be87e
Add a bug-compatibility flag to disable the
winadj@putty.projects.tartarus.org request. Not currently enabled
automatically, but should be usable as a manual workaround.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9592 cda61777-01e9-0310-a592-d414129be87e
Add a missing \define I accidentally assumed was there in r9592.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9593 cda61777-01e9-0310-a592-d414129be87e
Reduce the number of round-trips involved in opening an SSH-2 session
by sending most of the initial SSH_MSG_CHANNEL_REQUEST messages before
waiting for any replies.  The initial version of this code was a clever
thing with a two-pass loop, but that got hairy so I went for the simpler
approach of separating the request and reply code and having flags to
keep track of which requests have been sent.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9599 cda61777-01e9-0310-a592-d414129be87e
Rework bufchain code to allow for variable-sized granules.  
bufchain_add() now allocates at most one new granule.  Granules still 
have a minimum size, so small adds still get coalesced.

The main practical consequence of this is that PSCP and PSFTP now 
generate 4K SSH packets rather than 512-byte ones.  Also, the compiled 
code (on my Ubuntu box) is fractionally smaller.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9602 cda61777-01e9-0310-a592-d414129be87e
Use a single sftp_senddata() to send each SFTP packet, rather than
using one for the length field and one for the rest of the packet
contents. Since sftp_senddata() has no queuing or deferral mechanism
but instead constructs and sends an SSH2_MSG_CHANNEL_DATA message
immediately, this change has the effect of ceasing to split every SFTP
packet across two SSH messages.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9603 cda61777-01e9-0310-a592-d414129be87e
Tweak to SSH coroutine code: put line number in the coroutine state
structure, which is consistent with Simon's canonical version of the
macros.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9607 cda61777-01e9-0310-a592-d414129be87e
Fix an erroneous "case" fallthrough in ssh1_msg_channel_close, which was 
causing assertion failures when closing X11 channels in SSH-1.  Also fix 
another pasto.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9608 cda61777-01e9-0310-a592-d414129be87e
Reworking of packet delivery to coroutines in SSH-2.

Before, NULL in the dispatch table meant "send to the appropriate one of 
do_ssh2_transport() and do_ssh2_authconn()".  Now those (via small 
shims) are specified directly in the dispatch table, so ssh2_protocol() 
is much simpler.

In the process, this has somewhat centralised the handling of gross 
server protocol violations.  PuTTY will now disconnect with a rude 
message when (e.g.) OpenSSH sends us an SSH_MSG_UNIMPLEMENTED when we 
try to KEXINIT during authentication.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9609 cda61777-01e9-0310-a592-d414129be87e
De-duplicate code in KEXINIT generation.

There's no need to have identical code generating server-to-client and
client-to-server versions of the cipher and MAC lists; a couple of
twice-around loops will do fine.


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