X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=unix%2Fuxputty.c;h=d0ba55f68177a7bc68da8084d21e96a8104f692a;hb=2eb952ca31aa13d1f6f429305fbb6f43a9a28c56;hp=fbaf029d3b769478903356b18283d205f588a14d;hpb=13bac5ed69ce4cd603a21c940f82370ef8b0a44d;p=PuTTY.git diff --git a/unix/uxputty.c b/unix/uxputty.c index fbaf029d..d0ba55f6 100644 --- a/unix/uxputty.c +++ b/unix/uxputty.c @@ -7,11 +7,14 @@ #include #include #include +#include #include #include "putty.h" #include "storage.h" +#include "gtkcompat.h" + /* * Stubs to avoid uxpty.c needing to be linked in. */ @@ -50,9 +53,11 @@ static int got_host = 0; const int use_event_log = 1, new_session = 1, saved_sessions = 1; -int process_nonoption_arg(char *arg, Conf *conf, int *allow_launch) +int process_nonoption_arg(const char *arg, Conf *conf, int *allow_launch) { - char *p, *q = arg; + char *argdup, *p, *q; + argdup = dupstr(arg); + q = argdup; if (got_host) { /* @@ -61,7 +66,7 @@ int process_nonoption_arg(char *arg, Conf *conf, int *allow_launch) * argument, so that it will be deferred until it's a good * moment to run it. */ - int ret = cmdline_process_param("-P", arg, 1, conf); + int ret = cmdline_process_param("-P", argdup, 1, conf); assert(ret == 2); } else if (!strncmp(q, "telnet:", 7)) { /* @@ -76,8 +81,7 @@ int process_nonoption_arg(char *arg, Conf *conf, int *allow_launch) q += 2; conf_set_int(conf, CONF_protocol, PROT_TELNET); p = q; - while (*p && *p != ':' && *p != '/') - p++; + p += host_strcspn(p, ":/"); c = *p; if (*p) *p++ = '\0'; @@ -91,7 +95,7 @@ int process_nonoption_arg(char *arg, Conf *conf, int *allow_launch) /* * Otherwise, treat this argument as a host name. */ - p = arg; + p = argdup; while (*p && !isspace((unsigned char)*p)) p++; if (*p) @@ -101,6 +105,9 @@ int process_nonoption_arg(char *arg, Conf *conf, int *allow_launch) } if (got_host) *allow_launch = TRUE; + + sfree(argdup); + return 1; } @@ -122,6 +129,9 @@ char *platform_get_x_display(void) { return dupstr(display); } +const int share_can_be_downstream = TRUE; +const int share_can_be_upstream = TRUE; + int main(int argc, char **argv) { extern int pt_main(int argc, char **argv);