#include <stdlib.h>
#include <assert.h>
#include <unistd.h>
+#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include "putty.h"
#include "storage.h"
+#include "gtkcompat.h"
+
/*
* Stubs to avoid uxpty.c needing to be linked in.
*/
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) {
/*
* 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)) {
/*
/*
* Otherwise, treat this argument as a host name.
*/
- p = arg;
+ p = argdup;
while (*p && !isspace((unsigned char)*p))
p++;
if (*p)
}
if (got_host)
*allow_launch = TRUE;
+
+ sfree(argdup);
+
return 1;
}