Work around an SC bug that causes it to try to use the same register for
authorben <ben@cda61777-01e9-0310-a592-d414129be87e>
Sun, 23 Feb 2003 00:13:17 +0000 (00:13 +0000)
committerben <ben@cda61777-01e9-0310-a592-d414129be87e>
Sun, 23 Feb 2003 00:13:17 +0000 (00:13 +0000)
two purposes in s_wrpkt_prepare().  This makes SSH1 work on 68K Macs, at
least until I deactivate the terminal window...

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

mac/README.mac
ssh.c

index 1c0de3f..e09a682 100644 (file)
@@ -1,4 +1,4 @@
-$Id: README.mac,v 1.27 2003/02/11 23:10:34 ben Exp $
+$Id: README.mac,v 1.28 2003/02/23 00:13:17 ben Exp $
 
 Information about PuTTY for the Mac OS
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -61,9 +61,6 @@ Known bugs:
  * Display is far too slow.
  * Real bold doesn't compensate for changing character widths without Color
    QuickDraw. [MAYBE FIXED]
- * Compiling ssh.c using SC 8.8.4 with "-opt time" causes SSH1
-   connections to fail with "Incorrect CRC received on packet".  Using
-   "-opt none" works around this.
  * When the last terminal window closes, the Edit menu doesn't get disabled
    immediately, which it should.
  * When using the "VT100" font, text copied to the clipboard doesn't
diff --git a/ssh.c b/ssh.c
index 76dc2ec..9f7d192 100644 (file)
--- a/ssh.c
+++ b/ssh.c
@@ -1167,8 +1167,18 @@ static void s_wrpkt_start(Ssh ssh, int type, int len)
 
 static int s_wrpkt_prepare(Ssh ssh)
 {
-    int pad, len, biglen, i;
+    int pad, biglen, i;
     unsigned long crc;
+#ifdef __SC__
+    /*
+     * XXX various versions of SC (including 8.8.4) screw up the
+     * register allocation in this function and use the same register
+     * (D6) for len and as a temporary, with predictable results.  The
+     * following sledgehammer prevents this.
+     */
+    volatile
+#endif
+    int len;
 
     ssh->pktout.body[-1] = ssh->pktout.type;