Implement Simon's suggestion of moving DEFAULT_PROTOCOL into a per-backend-
[u/mdw/putty] / mac / mac.c
index 0e55933..fa2ec2f 100644 (file)
--- a/mac/mac.c
+++ b/mac/mac.c
@@ -1,4 +1,4 @@
-/* $Id: mac.c,v 1.27 2003/01/12 16:11:27 ben Exp $ */
+/* $Id: mac.c,v 1.30 2003/01/15 20:47:50 jacob Exp $ */
 /*
  * Copyright (c) 1999 Ben Harris
  * All rights reserved.
@@ -200,8 +200,17 @@ static void mac_startup(void) {
     windows.about = NULL;
     windows.licence = NULL;
 
-    default_protocol = DEFAULT_PROTOCOL;
-    default_port = DEFAULT_PORT;
+    default_protocol = be_default_protocol;
+    /* Find the appropriate default port. */
+    {
+       default_port = 0; /* illegal */
+       int i;
+       for (i = 0; backends[i].backend != NULL; i++)
+           if (backends[i].protocol == default_protocol) {
+               default_port = backends[i].backend->default_port;
+               break;
+           }
+    }
     flags = FLAG_INTERACTIVE;
 
     {
@@ -215,7 +224,6 @@ static void mac_startup(void) {
            LMSetCurDirStore(dirid);
        }
     }
-    init_ucs();
 }
 
 static void mac_eventloop(void) {
@@ -702,7 +710,7 @@ void old_keyfile_warning(void)
 
 }
 
-char *platform_default_s(char *name)
+char *platform_default_s(char const *name)
 {
     long smfs;
     Str255 pname;
@@ -724,7 +732,7 @@ char *platform_default_s(char *name)
     return NULL;
 }
 
-int platform_default_i(char *name, int def)
+int platform_default_i(char const *name, int def)
 {
     long smfs;