When Unix PuTTYgen gives brief usage information, it should mention "--help"!

[originally from svn r6732]
In the config dialog, clip RGB values to [0..255] rather than reducing them
mod 256.
Document that the RGB values can be edited, and their range.

[originally from svn r6734]
Random Unix puttygen improvements highlighted by a post to comp.security.ssh:
 - fix diagnostic if keyfile and '-t' both specified
 - add diagnostic for generating a key but discarding the private part
 - document '-q' option

[originally from svn r6750]
Spell out more explicitly what needs to be done with vanilla VC6, since it
seems to be becoming a FAQ.

[originally from svn r6752]
Some extra int64 functions.

[originally from svn r6778]
Large file support for psftp and pscp on both Windows and Unix.  On Unix
we set _FILE_OFFSET_BITS to 64 on the compiler command line (via mkfiles.pl),
and on Windows we use SetFilePointer and GetFileSize to cope with 64-bit sizes
where possible.  Not tested on Win9x.

[originally from svn r6783]
Aha! At long last I've managed to reproduce the intermittent problem
I've been having with the cursor sometimes restoring to the wrong
place when screen(1) terminates. The offending sequence of escape
sequences goes ESC 7 (save cursor), ESC [?47h (switch to alternate
screen), ESC 7 (save cursor _again_), do some stuff, ESC 8 (restore
cursor), run screen session for a bit, ESC [?47l (return to main
screen), ESC 8 (restore cursor). The final ESC 8 is expected to
restore the cursor to where it was saved by the initial ESC 7.

Translation: the ESC 7 saved cursor state is part of the state we
must swap out when switching to the alternate screen. In other
words, we need to track _four_ cursor positions: active and saved,
on each of main and alternate screen. Previously we were tracking
only three.

[originally from svn r6788]
Shifts left and right by 32 were tripping a gcc warning (fatal with
-Werror, of course) about shifting by more than the range of a data
type. They only appeared in `if' statements testing sizeof(off_t),
but gcc warns even when the code is unreachable. I've removed the
conditional code (the general case should still work even on 32-bit
machines), and hacked each shift by 32 into a pair of shifts by 16.

Note that the gcc warning is not just a helpful indication that you
may be using the wrong data type; it's actually pointing out ANSI-
undefined behaviour in shifting a signed integer beyond the size of
its type.

[originally from svn r6789]
Er, ahem. Other half of r6788. :-/

[originally from svn r6791]
[r6788 == 09f86ce7ec4f57794993c9299e1e4de62e17e075]
New piece of Windows infrastructure: winhandl.c takes Plink's
thread-based approach to stdin and stdout, wraps it in a halfway
sensible API, and makes it a globally available service across all
network tools.

There is no direct functionality enhancement from this checkin:
winplink.c now talks to the new API instead of doing it all
internally, but does nothing different as a result.

However, this should lay the groundwork for several diverse pieces
of work in future: pipe-based ProxyCommand on Windows, a serial port
back end, and (hopefully) a pipe-based means of communicating with
Pageant, which should have sensible blocking behaviour and hence
permit asynchronous agent requests and decrypt-on-demand.

[originally from svn r6797]
Small tweak to the new handle API: provide a `privdata' field in
each handle structure, set on initialisation and readable by an API
call.

[originally from svn r6798]
Bug fix: since the input thread does not wait for the event object
until _after_ its first read, we should not start by signalling that
object in order to trigger the first read. Ahem.

[originally from svn r6799]
Always initialise the `addresses' field of a SockAddr to NULL,
because it gets unconditionally sfree()d in sk_addr_free(). This
just bit me when running under the MSVC debugger; not sure how it
hasn't bitten anyone until now!

[originally from svn r6800]
Return a non-zero exit code in the event of a fatal-error SSH
session termination. `Close window only on clean exit' was not
working properly on Unix in the absence of this:
notify_remote_exit() was being called and ssh_return_exitcode was
returning zero, causing gtk_main_quit() to be called, _before_
connection_fatal() happened.

[originally from svn r6801]
Start using notify_remote_exit() in the Windows front end, in place
of the previous ad-hockery which depended on the return value from
select_result() and hence which will not adapt sensibly to a world
in which the primary session is something local rather than a
network connection.

[originally from svn r6802]
On cleanup, PSCP and PSFTP should explicitly check that the back end
is still running rather than relying on ssh_sftp_loop_iteration() to
return a bogus value.

[originally from svn r6803]
Cleanups to reduce dependency on Windows SFTP tools always having a
real network socket.

[originally from svn r6804]
Another bug fix: always set the busy flag when telling a subthread
to do something, otherwise handle_get_events will forget to tell the
front end to check for that subthread finishing. This applies even
when we're only setting `busy' to tell the subthread to terminate!

[originally from svn r6805]
ProxyCommand support for Windows, using the new winhandl.c API.
Seems a bit clunky when I actually try to use it - not sure why -
but I think all the actual functionality is there.

[originally from svn r6806]
We _can_ have handle_throttle() called on defunct handles after all,
so it should just do nothing rather than failing an assertion.

[originally from svn r6807]