u/mdw/putty
21 years agoAdd an entry for the Mac version of PuTTY.
ben [Mon, 2 Dec 2002 21:03:14 +0000 (21:03 +0000)]
Add an entry for the Mac version of PuTTY.

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

21 years agoAdd support for generating MPW Makefiles. This makes the following changes:
ben [Mon, 2 Dec 2002 21:01:11 +0000 (21:01 +0000)]
Add support for generating MPW Makefiles.  This makes the following changes:

* splitline gets support for changing the continuation character.
* deps returns a data structure for the output routine to format as
  appropriate.
* There's a new program type, [M], for Macintosh.
* There's a new backend to output mac/Makefile.mpw.

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

21 years agoImprove support for non-colour displays by adding a mask of attributes to
ben [Fri, 29 Nov 2002 00:32:03 +0000 (00:32 +0000)]
Improve support for non-colour displays by adding a mask of attributes to
ignore when breaking text into runs for display, and implement setting this
on Mac (other ports just use 0xffffffff).

We don't use DeviceLoop for this any more because Apple Technical Q&A
QA1024 says we shouldn't.  Unlike their example, we don't depend on the
Display Manager's being present either.

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

21 years agoDon't call SetFractEnable every time we draw some text, since
ben [Thu, 28 Nov 2002 21:10:55 +0000 (21:10 +0000)]
Don't call SetFractEnable every time we draw some text, since
SetFractEnable unconditionally flushes the Font Manager's width cache,
and the default is fine for us anyway.  This more or less doubles
redraw speed, which is nice, but still not really fast enough.

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

21 years agoFollow the recommendations in Tech Note TB575 for clipping off the space
ben [Thu, 28 Nov 2002 21:02:07 +0000 (21:02 +0000)]
Follow the recommendations in Tech Note TB575 for clipping off the space
for the horizontal scroll bar when drawing the grow box.

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

21 years agoUse StdText() rather than DrawText, so that (later) we can support scaling of
ben [Thu, 28 Nov 2002 00:25:09 +0000 (00:25 +0000)]
Use StdText() rather than DrawText, so that (later) we can support scaling of
text to get double-width etc.

Also set the background when scrolling in Original Quickdraw.

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

21 years agoIncrease the size of the `font' buffer in the Config structure, for
simon [Tue, 26 Nov 2002 19:35:40 +0000 (19:35 +0000)]
Increase the size of the `font' buffer in the Config structure, for
the benefit of X font names which are rather more verbose than
Windows. One day I want to replace all these fixed-size buffers with
sensible dynamically allocated stuff, but not today.

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

21 years agoSubstantial overhaul of colour handling in do_text(). Highlights include:
ben [Tue, 26 Nov 2002 01:32:51 +0000 (01:32 +0000)]
Substantial overhaul of colour handling in do_text().  Highlights include:
* No more mucking about with transfer modes.  We always set up the foreground
  and background sensibly, EraseRect the whole lot and use srcOr.  Apple
  Tech Note QD505 suggests that this should be faster than srcCopy.
* Always use the Palette Manager if we've got Color QuickDraw, even in 1bpp
  modes.
* Apply the cursor colours _after_ all the other stuff, rather than trying to
  get them through everything else intact.

Unfortunately, this doesn't make much difference to the speed.

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

21 years agoMake the default font on Mac OS be Monaco 9 rather than Monaco 10, since the
ben [Mon, 25 Nov 2002 23:34:59 +0000 (23:34 +0000)]
Make the default font on Mac OS be Monaco 9 rather than Monaco 10, since the
former is available as a bitmap.

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

21 years agoRemove a spurious 'q'.
ben [Mon, 25 Nov 2002 19:02:23 +0000 (19:02 +0000)]
Remove a spurious 'q'.

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

21 years agoAdd support for displaying the licence window.
ben [Sun, 24 Nov 2002 15:08:52 +0000 (15:08 +0000)]
Add support for displaying the licence window.

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

21 years agoFix scrolling on systems without Color QuickDraw. It seems that the current
ben [Sun, 24 Nov 2002 00:38:44 +0000 (00:38 +0000)]
Fix scrolling on systems without Color QuickDraw.  It seems that the current
background colour and pen mode have some silly effects on ScrollRect, so
set them back to their defaults before calling it.

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

21 years agoDon't try to initialise the palette unless we have Color QuickDraw. This gets
ben [Sat, 23 Nov 2002 22:36:56 +0000 (22:36 +0000)]
Don't try to initialise the palette unless we have Color QuickDraw.  This gets
PuTTY running on my Mac SE again (albeit very slowly and with scroll
optimisation broken for some reason).

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

21 years agoFix a bug in scroll_display(): when the scrolled region contains the cursor
ben [Sat, 23 Nov 2002 21:42:46 +0000 (21:42 +0000)]
Fix a bug in scroll_display(): when the scrolled region contains the cursor
we need to update dispcurs as well as disptext.

Add scroll optimisation to scroll().  This makes it rather obvious that scroll
optimisation is breaking with PuTTY's usual policy of lazy updates, since
scrolling is done eagerly.  Fixing this so that all the scrolling is saved
up for do_paint would be nice, but non-trivial.

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

21 years agoRemove stray debugging printfs.
ben [Sat, 23 Nov 2002 20:40:22 +0000 (20:40 +0000)]
Remove stray debugging printfs.

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

21 years agoAdd a Config * argument to ldisc_create(), and use it in place of the global
ben [Sat, 23 Nov 2002 20:02:38 +0000 (20:02 +0000)]
Add a Config * argument to ldisc_create(), and use it in place of the global
cfg throughout ldisc.c.  Not tested other than on Mac, but all other ports
just pass &cfg as this argument for now.

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

21 years agoReturn the state information from loop_init() in the correct way. This means
ben [Sat, 23 Nov 2002 19:58:55 +0000 (19:58 +0000)]
Return the state information from loop_init() in the correct way.  This means
the backend actually works now.

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

21 years agoAdd a "Config *" argument to term_init(), and use that instead of the global
ben [Sat, 23 Nov 2002 19:01:01 +0000 (19:01 +0000)]
Add a "Config *" argument to term_init(), and use that instead of the global
cfg throughout the terminal emulator.  Not tested in PuTTY and pterm, but they
just pass in &cfg.

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

21 years agoOnly try to retrieve a 'vers' resource from the current resource file (the
ben [Sat, 23 Nov 2002 18:22:47 +0000 (18:22 +0000)]
Only try to retrieve a 'vers' resource from the current resource file (the
application), rather from the entire chain.  This prevents us displaying the
System version if PuTTY doesn't have one.  Also cope with not finding any
'vers' resource.

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

21 years agoWe don't currently need the Thread Manager (and all being well we never will),
ben [Sat, 23 Nov 2002 15:11:13 +0000 (15:11 +0000)]
We don't currently need the Thread Manager (and all being well we never will),
so stop checking for it.

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

21 years agoOn a keypress, hide the mouse cursor, send the key to the line discipline
ben [Sat, 23 Nov 2002 14:22:11 +0000 (14:22 +0000)]
On a keypress, hide the mouse cursor, send the key to the line discipline
(rather than straight to the backend), and then prod the terminal.  I think
this is closer to the correct set of things to do.

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

21 years agoRemove a debugging printf.
ben [Sat, 23 Nov 2002 13:16:36 +0000 (13:16 +0000)]
Remove a debugging printf.

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

21 years agoBring in some of my scroll-optimisation stuff from the old Mac port.
ben [Sat, 23 Nov 2002 13:07:29 +0000 (13:07 +0000)]
Bring in some of my scroll-optimisation stuff from the old Mac port.
This introduces a new front-end function, do_scroll(), which is expected to
scroll a part of the physical display and cause repaint events for any
areas that couldn't be scrolled (e.g. because they were hidden).
scroll_display() is a wrapper around this which also updates disptext to
match.

Currently, scroll_display is only used in response to user scrollback requests
(via term_scroll()), but extending scroll() to use it as well should be
easy.

All of this is conditional on the front end's defining OPTIMISE_SCROLL, since
only the Mac front end currently implements do_scroll().

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

21 years agoNote about CTRL-C trick for copying text of error dialogs
jacob [Sat, 23 Nov 2002 11:22:57 +0000 (11:22 +0000)]
Note about CTRL-C trick for copying text of error dialogs

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

21 years agoUpdate the status of the Mac port.
ben [Fri, 22 Nov 2002 00:07:31 +0000 (00:07 +0000)]
Update the status of the Mac port.

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

21 years agoNote that default will change to SSH-2 next release
jacob [Thu, 21 Nov 2002 00:15:52 +0000 (00:15 +0000)]
Note that default will change to SSH-2 next release

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

21 years agoFixes for more robust handling of command-line parse errors.
simon [Wed, 20 Nov 2002 20:09:02 +0000 (20:09 +0000)]
Fixes for more robust handling of command-line parse errors.

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

21 years agoInterchange two parameters in a printf, to prevent a silly segfault.
simon [Wed, 20 Nov 2002 19:56:10 +0000 (19:56 +0000)]
Interchange two parameters in a printf, to prevent a silly segfault.

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

21 years agoLargely-placeholder man page for Plink, for the sake of not
simon [Wed, 20 Nov 2002 19:49:59 +0000 (19:49 +0000)]
Largely-placeholder man page for Plink, for the sake of not
irritating `make install'. Thanks RJK, again.

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

21 years agoFiddle with mac_initpalette() so that the cursor works in 2bpp modes as well.
ben [Wed, 20 Nov 2002 00:33:44 +0000 (00:33 +0000)]
Fiddle with mac_initpalette() so that the cursor works in 2bpp modes as well.

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

21 years agoRemove has_focus from Session and use the one in Terminal. Active vs passive
ben [Wed, 20 Nov 2002 00:11:05 +0000 (00:11 +0000)]
Remove has_focus from Session and use the one in Terminal.  Active vs passive
cursor now behaves correctly.

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

21 years agoRemove CURSOR_FG_BOLD and CURSOR_BG_BOLD, and hence bring reality in line
ben [Tue, 19 Nov 2002 23:59:27 +0000 (23:59 +0000)]
Remove CURSOR_FG_BOLD and CURSOR_BG_BOLD, and hence bring reality in line
with palette_reset()'s expectations.

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

21 years agoPass co-ordinates to term_paint() in characters rather than pixels. Partial
ben [Tue, 19 Nov 2002 22:05:48 +0000 (22:05 +0000)]
Pass co-ordinates to term_paint() in characters rather than pixels.  Partial
redraws now work rather better.

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

21 years agoAdd mac/ to include paths after discussion with bjh21
jacob [Tue, 19 Nov 2002 19:36:14 +0000 (19:36 +0000)]
Add mac/ to include paths after discussion with bjh21

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

21 years agoA couple of useful test backends.
ben [Tue, 19 Nov 2002 12:29:45 +0000 (12:29 +0000)]
A couple of useful test backends.

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

21 years agoMac resource source file, missed in last commit.
ben [Tue, 19 Nov 2002 02:14:35 +0000 (02:14 +0000)]
Mac resource source file, missed in last commit.

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

21 years agoTentative merge of ben-mac-port (only dead for three years!) into the trunk.
ben [Tue, 19 Nov 2002 02:13:46 +0000 (02:13 +0000)]
Tentative merge of ben-mac-port (only dead for three years!) into the trunk.
This doesn't include any mkfiles.pl glue, and is missing one or two other
fixes.  The terminal emulator is kind of working, though, as, I believe, is
the store module.  Everything else is yet to be done.

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

21 years agoWhen processing input, refer to CR and LF as \015 and \012 respectively,
ben [Mon, 18 Nov 2002 23:49:30 +0000 (23:49 +0000)]
When processing input, refer to CR and LF as \015 and \012 respectively,
rather than \r and \n.  The latter tend to get swapped around by Mac C
compilers.

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

21 years agoISO-IR entry 157 appears to correspond to ISO/IEC 8859-10, and lists
ben [Mon, 18 Nov 2002 22:27:25 +0000 (22:27 +0000)]
ISO-IR entry 157 appears to correspond to ISO/IEC 8859-10, and lists
code point 3/13 as HORIZONTAL BAR, which agrees with unicode.org's mapping
table.  Change ours to match (it used to have EM DASH, courtesy of RDB).
This brings all our 8859-to-Unicode tables into line with unicode.org.

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

21 years agoMore comment cleanup.
ben [Mon, 18 Nov 2002 20:06:46 +0000 (20:06 +0000)]
More comment cleanup.

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

21 years agoDon't forget the IEC!
ben [Mon, 18 Nov 2002 18:24:35 +0000 (18:24 +0000)]
Don't forget the IEC!

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

21 years agoBoth ISO and unicode.org now admit the existence of 8859-11 (:2001, FWIW),
ben [Mon, 18 Nov 2002 18:14:18 +0000 (18:14 +0000)]
Both ISO and unicode.org now admit the existence of 8859-11 (:2001, FWIW),
and unicode.org agrees with our mapping table.  Update text accordingly.

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

21 years agoThanks to Hans-Juergen Petrich for spotting this tiny memory leak:
simon [Sun, 17 Nov 2002 15:06:16 +0000 (15:06 +0000)]
Thanks to Hans-Juergen Petrich for spotting this tiny memory leak:
`otherbuf' should still be freed even if the RegEnumKey function
that was supposed to fill it with data failed. While I'm at it, also
remove the redundant check for its non-NULL-ness (what's the point
of having a malloc wrapper that dies rather than return NULL if you
then waste effort checking its return value for NULL _anyway_, eh?).

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

21 years agoApple's C compilers don't think that putting parentheses around assignments
ben [Sun, 17 Nov 2002 02:00:06 +0000 (02:00 +0000)]
Apple's C compilers don't think that putting parentheses around assignments
in "if" conditions is enough.  Use an actual comparison against NULL instead.

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

21 years agoChange a temporary buffer from unsigned chars to chars, avoiding a pointer-cast
ben [Sun, 17 Nov 2002 01:56:01 +0000 (01:56 +0000)]
Change a temporary buffer from unsigned chars to chars, avoiding a pointer-cast
warning.

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

21 years agoBump latest version to 0.53b for release!
simon [Tue, 12 Nov 2002 18:55:41 +0000 (18:55 +0000)]
Bump latest version to 0.53b for release!

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

21 years agoUse <stddef.h> to get wchar_t, rather than <wchar.h> (or nothing, in putty.h).
ben [Sun, 10 Nov 2002 00:03:55 +0000 (00:03 +0000)]
Use <stddef.h> to get wchar_t, rather than <wchar.h> (or nothing, in putty.h).
Both are required to contain wchar_t in C99, but only <stddef.h> does in the
version of MPW I've got here.

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

21 years agoRename CharWidth() to char_width(). The former name clashes with an API
ben [Sat, 9 Nov 2002 21:46:21 +0000 (21:46 +0000)]
Rename CharWidth() to char_width().  The former name clashes with an API
function in Mac OS.

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

21 years agoImprove robustness in random seed file handling.
simon [Thu, 7 Nov 2002 20:01:04 +0000 (20:01 +0000)]
Improve robustness in random seed file handling.

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

21 years agoRobustness fixes for KEXINIT handling and others. In particular, I've
simon [Thu, 7 Nov 2002 19:49:03 +0000 (19:49 +0000)]
Robustness fixes for KEXINIT handling and others. In particular, I've
created a self-mallocing variant of sprintf, to obviate any future
need for paranoid %.100s type stuff in format strings.

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

21 years agoBorland makefile needs to define _WINDOWS; apparently this makefile
simon [Thu, 7 Nov 2002 19:37:36 +0000 (19:37 +0000)]
Borland makefile needs to define _WINDOWS; apparently this makefile
hasn't worked since the Unix port started and nobody has noticed
until now :-)

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

21 years agoPacket-level logging should now work properly in Unix Plink.
simon [Tue, 5 Nov 2002 13:21:03 +0000 (13:21 +0000)]
Packet-level logging should now work properly in Unix Plink.

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

21 years agoFix command-line error handling in pterm. (Hint: wrapping a multi-
simon [Tue, 5 Nov 2002 13:20:42 +0000 (13:20 +0000)]
Fix command-line error handling in pterm. (Hint: wrapping a multi-
statement macro in `do ... while (0)' and putting a `continue'
within it don't go well together. Oops.)

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

21 years agoSubstitute `-' (magical hyphen) for `\-' (inert minus sign) in the
simon [Tue, 5 Nov 2002 09:37:31 +0000 (09:37 +0000)]
Substitute `-' (magical hyphen) for `\-' (inert minus sign) in the
manpage. Fixes Debian bug #167761.

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

21 years agoHalf of Lars Gunnarsson's iXplorer compatibility patch: the PSFTP
simon [Sun, 3 Nov 2002 08:46:35 +0000 (08:46 +0000)]
Half of Lars Gunnarsson's iXplorer compatibility patch: the PSFTP
login prompt should be fflushed (presumably fgets fails to implicitly
do this when stdin and stdout are redirected weirdly).

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

21 years agoProbably about time we mentioned the nascent Unix port in the FAQ.
simon [Sat, 2 Nov 2002 16:27:17 +0000 (16:27 +0000)]
Probably about time we mentioned the nascent Unix port in the FAQ.
Not that I desperately want to shout about it just yet, but I feel a
bit bad about the FAQ saying `we don't have a Unix port, anyone who
told you so was wrong'. :-)

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

21 years agoImprove shadow bold mode: set the default shadow bold offset to +1
simon [Sat, 2 Nov 2002 16:16:35 +0000 (16:16 +0000)]
Improve shadow bold mode: set the default shadow bold offset to +1
not -1 (it turns out _most_ X fonts prefer the former, though
irritatingly my favourite real X font used to prefer the latter
which was why I made the X version of my Font Of Choice do so too),
and also clip to the boundaries of the rectangle we should be
drawing text in. This still doesn't completely prevent display
corruption in the case where text drawn in one sweep is partially
overwritten in a future one, but gnome-terminal has this problem
too, and now we've got the right default SB offset _and_ offer the
opportunity to reconfigure it I think this is pretty good for now.

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

21 years agoAnother signal-handling refinement from RJK: the SIGCHLD handler
simon [Sat, 2 Nov 2002 16:05:26 +0000 (16:05 +0000)]
Another signal-handling refinement from RJK: the SIGCHLD handler
should be prepared to reap more than one child per invocation if
necessary, since we do after all have two.

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

21 years agoImprove the noise collection for the internal random pool.
simon [Sat, 2 Nov 2002 15:23:20 +0000 (15:23 +0000)]
Improve the noise collection for the internal random pool.

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

21 years agoRJK's general signal-handling robustness patch. Should fix the weird
simon [Sat, 2 Nov 2002 14:35:57 +0000 (14:35 +0000)]
RJK's general signal-handling robustness patch. Should fix the weird
spin behaviour occasionally seen after pterm's child process dies.

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

21 years agos/public/private/ spotted by Clint Hastings; also change a "public key"
jacob [Fri, 1 Nov 2002 21:50:35 +0000 (21:50 +0000)]
s/public/private/ spotted by Clint Hastings; also change a "public key"
to "key pair"

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

21 years agoIntroduce program category U, for non-GTK-requiring Unix apps. Plink
simon [Fri, 1 Nov 2002 18:51:55 +0000 (18:51 +0000)]
Introduce program category U, for non-GTK-requiring Unix apps. Plink
doesn't need to be linked with libgtk, libgdk, libX11 etc!

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

21 years agoPrevent another segfault. Oops.
simon [Fri, 1 Nov 2002 18:51:22 +0000 (18:51 +0000)]
Prevent another segfault. Oops.

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

21 years ago.HLP files should be ignored as well. Oops.
simon [Fri, 1 Nov 2002 13:49:25 +0000 (13:49 +0000)]
.HLP files should be ignored as well. Oops.

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

21 years agoAdd a .cvsignore for the Unix subdir
simon [Fri, 1 Nov 2002 13:37:39 +0000 (13:37 +0000)]
Add a .cvsignore for the Unix subdir

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

21 years agoImprove handling of oobinline sockets; Plink in telnet mode now
simon [Fri, 1 Nov 2002 13:36:48 +0000 (13:36 +0000)]
Improve handling of oobinline sockets; Plink in telnet mode now
doesn't hang when you hit ^C, which is nice. I think a better
solution would involve nonblocking sockets; as it stands it's a
little dependent on what may be quirks of the Linux socket layer.

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

21 years agoAnother valgrind-caught error. This one has apparently been there
simon [Fri, 1 Nov 2002 13:01:14 +0000 (13:01 +0000)]
Another valgrind-caught error. This one has apparently been there
since the Dawn O' Time, and consisted of me putting the two halves
of a short-circuiting bounds check the wrong way round: instead of
`p_in_range && *p', I had `*p && p_in_range'. Oops. valgrind rocks.

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

21 years agovalgrind has caught two more uninitialised elements in the SSH
simon [Fri, 1 Nov 2002 12:59:09 +0000 (12:59 +0000)]
valgrind has caught two more uninitialised elements in the SSH
context structure. I knew the Unix port would be a good idea!

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

21 years agoImplement access to the SSH agent. This ought to make agent
simon [Fri, 1 Nov 2002 12:55:13 +0000 (12:55 +0000)]
Implement access to the SSH agent. This ought to make agent
forwarding work as well, of course.

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

21 years agoReplace a \r\n with an ordinary \n - this isn't Windows!
simon [Fri, 1 Nov 2002 12:54:51 +0000 (12:54 +0000)]
Replace a \r\n with an ordinary \n - this isn't Windows!

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

21 years agoStop the segfault on failure to resolve a host name.
simon [Fri, 1 Nov 2002 12:54:22 +0000 (12:54 +0000)]
Stop the segfault on failure to resolve a host name.

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

21 years agoAdd a \n at the end of an error message - oops.
simon [Fri, 1 Nov 2002 12:54:03 +0000 (12:54 +0000)]
Add a \n at the end of an error message - oops.

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

21 years agoMove an output newline to make username entry in Plink/SSH2 look
simon [Fri, 1 Nov 2002 12:53:45 +0000 (12:53 +0000)]
Move an output newline to make username entry in Plink/SSH2 look
more sensible.

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

21 years agoPass int rather than char to va_arg (the latter gets promoted).
simon [Fri, 1 Nov 2002 12:53:10 +0000 (12:53 +0000)]
Pass int rather than char to va_arg (the latter gets promoted).

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

21 years agoSplit a trigraph sequence in a string constant.
simon [Fri, 1 Nov 2002 12:52:51 +0000 (12:52 +0000)]
Split a trigraph sequence in a string constant.

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

21 years agoFirst attempt at a Unix port of Plink. Seems to basically work;
simon [Thu, 31 Oct 2002 19:49:52 +0000 (19:49 +0000)]
First attempt at a Unix port of Plink. Seems to basically work;
doesn't yet use the SSH agent, no way to specify arbitrary config
options, no manpage yet, couple of other fiddly things need doing,
but it makes SSH connections and doesn't fall over horribly so I say
it's a good start. Now to run it under valgrind...

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

21 years agoRJK's `pterm --help' patch. I _must_ find a better alternative to
simon [Wed, 30 Oct 2002 18:22:37 +0000 (18:22 +0000)]
RJK's `pterm --help' patch. I _must_ find a better alternative to
this init sequence - it surely can't be right that `pterm --help'
with no DISPLAY complains at the lack of DISPLAY rather than giving
a help message!

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

21 years agoRJK's `make install' patch for the Unix makefile.
simon [Wed, 30 Oct 2002 18:17:56 +0000 (18:17 +0000)]
RJK's `make install' patch for the Unix makefile.

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

21 years agoFurther deglobalisation: settings.c now has a more sensible interface.
simon [Wed, 30 Oct 2002 18:12:46 +0000 (18:12 +0000)]
Further deglobalisation: settings.c now has a more sensible interface.

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

21 years agoFix some consts.
simon [Wed, 30 Oct 2002 18:12:22 +0000 (18:12 +0000)]
Fix some consts.

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

21 years agoMore preparatory work: remove the <windows.h> include from lots of
simon [Wed, 30 Oct 2002 17:57:31 +0000 (17:57 +0000)]
More preparatory work: remove the <windows.h> include from lots of
source files in which it's no longer required (it was previously
required in anything that included <putty.h>, but not any more).
Also moved a couple of stray bits of exposed WinSock back into
winnet.c (getservbyname from ssh.c and AF_INET from proxy.c).

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

21 years agoPreparatory work before attempting a Unix port of plink: mkfiles.pl
simon [Wed, 30 Oct 2002 17:56:05 +0000 (17:56 +0000)]
Preparatory work before attempting a Unix port of plink: mkfiles.pl
needs to be able to handle separate Recipe entries for the same
program with different types (plink [C] and plink [X] for example,
with different object lists).

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

21 years agoYikes - put back a #include I accidentally removed two revs ago!
simon [Tue, 29 Oct 2002 16:54:09 +0000 (16:54 +0000)]
Yikes - put back a #include I accidentally removed two revs ago!
That'd have been embarrassing. Mind you I'd like to remove this
particular #include for good anyway, but the time is not now...

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

21 years agoHmm. Probably best initialise mainchan as well; oops.
simon [Tue, 29 Oct 2002 14:41:10 +0000 (14:41 +0000)]
Hmm. Probably best initialise mainchan as well; oops.

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

21 years agoTry actually initialising ssh->v1_compressing. With any luck this
simon [Tue, 29 Oct 2002 13:05:20 +0000 (13:05 +0000)]
Try actually initialising ssh->v1_compressing. With any luck this
will be what was causing Owen's crash report today.

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

21 years agoterminal.c should call the frontend beep() routine even with
simon [Mon, 28 Oct 2002 21:58:07 +0000 (21:58 +0000)]
terminal.c should call the frontend beep() routine even with
mode==BELL_VISUAL, otherwise taskbar flashing won't happen on visual
bells. It's up to the frontend routine to spot BELL_VISUAL and avoid
making any noise.

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

21 years agoCloseOnExit now defaults to COE_ALWAYS for pterm, bringing it back
simon [Mon, 28 Oct 2002 17:39:21 +0000 (17:39 +0000)]
CloseOnExit now defaults to COE_ALWAYS for pterm, bringing it back
into line with most other xtermalikes. On Unix, the exit code of a
shell is the last exit code of one of its child processes, even if
it's an interactive shell - so some pterms will close and some will
not for no particularly good reason. Power-detaching a screen
session is especially bad for this.
COE_NORMAL is still useful for specialist purposes (running a single
command in its own pterm), but I don't think it's a sane default,
unfortunately.

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

21 years agoFix Alt+numberpad in pterm. For a start, there was a bug whereby if
simon [Mon, 28 Oct 2002 17:34:45 +0000 (17:34 +0000)]
Fix Alt+numberpad in pterm. For a start, there was a bug whereby if
a pterm came up while Alt was down, then releasing it would cause a
^@ to be generated. Also, though, I've decided that Alt plus a
single numberpad key should not generate a low-numbered control
code, because that's too easy to do by mistake and the codes are too
powerful. Anyone who really _wants_ to create a ^C or ^D from the
numberpad can do Alt-03 or Alt-04 easily enough; two-digit codes and
more such as Alt-65 are unaffected.

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

21 years agoAnother deglobalisation bug: failed to initialise term->curstype.
simon [Mon, 28 Oct 2002 17:30:47 +0000 (17:30 +0000)]
Another deglobalisation bug: failed to initialise term->curstype.
Thanks to valgrind for finding this one (aha! I knew there would be
benefits from doing a Unix port!).

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

21 years agoFirst bug discovered as a result of global-removal: pasting into
simon [Mon, 28 Oct 2002 09:38:28 +0000 (09:38 +0000)]
First bug discovered as a result of global-removal: pasting into
pterm caused a crash because I had the wrong prototype for the
selection_received event handler. Should be fixed.

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

21 years agoArrgh! _Another_ missed commit. I really must do something about
simon [Sun, 27 Oct 2002 09:24:47 +0000 (09:24 +0000)]
Arrgh! _Another_ missed commit. I really must do something about
this bad habit of mine :-/

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

21 years agoRetire another global in favour of adding a feature to the
simon [Sat, 26 Oct 2002 14:06:52 +0000 (14:06 +0000)]
Retire another global in favour of adding a feature to the
terminal.c interface.

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

21 years agoYet more global-removal. The static variables in logging.c are now
simon [Sat, 26 Oct 2002 12:58:13 +0000 (12:58 +0000)]
Yet more global-removal. The static variables in logging.c are now
absent, and also (I think) all the frontend request functions (such
as request_resize) take a context pointer, so that multiple windows
can be handled sensibly. I wouldn't swear to this, but I _think_
that only leaves the Unicode stuff as the last stubborn holdout.

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

21 years agoRichard points out that it would probably help if I committed
simon [Sat, 26 Oct 2002 12:42:07 +0000 (12:42 +0000)]
Richard points out that it would probably help if I committed
ldisc.h. Bah. :-)

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

21 years agoX forwarding authentication is now invented on a per-SSH-connection
simon [Sat, 26 Oct 2002 11:23:15 +0000 (11:23 +0000)]
X forwarding authentication is now invented on a per-SSH-connection
basis, so the statics are gone from x11fwd.c.

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

21 years agoFix proxy.c so that the static variables become const.
simon [Sat, 26 Oct 2002 11:12:24 +0000 (11:12 +0000)]
Fix proxy.c so that the static variables become const.

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

21 years agoReorganised the Unicode layer somewhat: moved luni_send and
simon [Sat, 26 Oct 2002 11:08:59 +0000 (11:08 +0000)]
Reorganised the Unicode layer somewhat: moved luni_send and
lpage_send out into the line discipline, making them _clients_ of
the Unicode layer rather than part of it. This means they can access
ldisc->term, which in turn means I've been able to remove the
temporary global variable `term'. We're slowly getting there.

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

21 years agoPort forwarding module now passes backend handles around properly.
simon [Sat, 26 Oct 2002 10:33:59 +0000 (10:33 +0000)]
Port forwarding module now passes backend handles around properly.
As a result I've now been able to turn the global variables `back'
and `backhandle' into module-level statics in the individual front
ends. Now _that's_ progress!

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

21 years agoLine discipline module now uses dynamically allocated data. Also
simon [Sat, 26 Oct 2002 10:16:19 +0000 (10:16 +0000)]
Line discipline module now uses dynamically allocated data. Also
fixed one or two other minor problems.

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

21 years agoOops; remembering to call term_provide_resize_fn in the Unix front
simon [Fri, 25 Oct 2002 22:00:22 +0000 (22:00 +0000)]
Oops; remembering to call term_provide_resize_fn in the Unix front
end would probably help. Thanks Colin.

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