diff --git a/adb.c b/adb.c index 242f11e1b..e93e282c1 100644 --- a/adb.c +++ b/adb.c @@ -192,8 +192,18 @@ static const char *adb_init(void *frontend_handle, void **backend_handle, } /* send initial data to adb server */ - - sprintf_s(sendhost,512,"%04xhost:%s",strlen(host)+5,host); +#if _MSC_VER + sprintf_s +#else + snprintf +#endif + (sendhost, 512, +#if _MSC_VER + "%04xhost:%s" +#else + "%04zxhost:%s" +#endif + , strlen(host)+5, host); sk_write(adb->s,sendhost,strlen(host)+9); sk_flush(adb->s); diff --git a/cmdline.c b/cmdline.c index 73bab6c3b..6e9a2c1bf 100644 --- a/cmdline.c +++ b/cmdline.c @@ -221,7 +221,8 @@ int cmdline_process_param(char *p, char *value, int need_save, Conf *conf) RETURN(1); UNAVAILABLE_IN(TOOLTYPE_FILETRANSFER | TOOLTYPE_NONNETWORK); SAVEABLE(0); - default_protocol = cfg->protocol = PROT_ADB; + default_protocol = PROT_ADB; + conf_set_int(conf, CONF_protocol, default_protocol); } if (!strcmp(p, "-serial")) { RETURN(1); diff --git a/mkfiles.pl b/mkfiles.pl index d703e3d95..306b0c344 100755 --- a/mkfiles.pl +++ b/mkfiles.pl @@ -1004,8 +1004,6 @@ sub manpages { "ULDFLAGS = \$(LDFLAGS)\n". "ifeq (,\$(findstring NO_GSSAPI,\$(COMPAT)))\n". "ifeq (,\$(findstring STATIC_GSSAPI,\$(COMPAT)))\n". - "XLDFLAGS+= -ldl\n". - "ULDFLAGS+= -ldl\n". "else\n". "CFLAGS+= -DNO_LIBDL \$(shell \$(KRB5CONFIG) --cflags gssapi)\n". "XLDFLAGS+= \$(shell \$(KRB5CONFIG) --libs gssapi)\n". @@ -1079,6 +1077,8 @@ sub manpages { (join " ", map {"-I$dirpfx$_"} @srcdirs)). " -D _FILE_OFFSET_BITS=64\n". "ULDFLAGS = \$(LDFLAGS)\n". + "XLDFLAGS+= -ldl\n". + "ULDFLAGS+= -ldl\n". "INSTALL=install\n". "INSTALL_PROGRAM=\$(INSTALL)\n". "INSTALL_DATA=\$(INSTALL)\n". diff --git a/unix/gtkdlg.c b/unix/gtkdlg.c index 50aa4fad5..cdc1f5b91 100644 --- a/unix/gtkdlg.c +++ b/unix/gtkdlg.c @@ -2854,7 +2854,7 @@ int do_config_box(const char *title, Conf *conf, int midsession, ctrlbox = ctrl_new_box(); protocol = conf_get_int(conf, CONF_protocol); - setup_config_box(ctrlbox, midsession, protocol, protcfginfo); + setup_config_box(ctrlbox, midsession, protocol, protcfginfo, -1); unix_setup_config_box(ctrlbox, midsession, protocol); gtk_setup_config_box(ctrlbox, midsession, window); diff --git a/unix/gtkwin.c b/unix/gtkwin.c index da40e5447..e128675a2 100644 --- a/unix/gtkwin.c +++ b/unix/gtkwin.c @@ -3411,7 +3411,7 @@ static void update_savedsess_menu(GtkMenuItem *menuitem, gpointer data) gtk_container_foreach(GTK_CONTAINER(inst->sessionsmenu), (GtkCallback)gtk_widget_destroy, NULL); - get_sesslist(&sesslist, TRUE); + get_sesslist(&sesslist, TRUE, -1); /* skip sesslist.sessions[0] == Default Settings */ for (i = 1; i < sesslist.nsessions; i++) { GtkWidget *menuitem = @@ -3434,7 +3434,7 @@ static void update_savedsess_menu(GtkMenuItem *menuitem, gpointer data) gtk_container_add(GTK_CONTAINER(inst->sessionsmenu), menuitem); gtk_widget_show(menuitem); } - get_sesslist(&sesslist, FALSE); /* free up */ + get_sesslist(&sesslist, FALSE, -1); /* free up */ } void set_window_icon(GtkWidget *window, const char *const *const *icon, diff --git a/unix/urlhack_unix.c b/unix/urlhack_unix.c new file mode 100644 index 000000000..222bec557 --- /dev/null +++ b/unix/urlhack_unix.c @@ -0,0 +1,37 @@ +#include +#include +#include + +#include "urlhack.h" + +void urlhack_launch_url(const char* app, const char *url) +{ + const size_t max = 4000; + char buf[max]; + const char *browser = NULL; + + if (app) + browser = app; + if (NULL == browser || 0 == strlen(browser)) + browser = "xdg-open"; + + snprintf(buf, max, "%s %s", browser, url); + + if (!system(buf)) + printf("couldn't run browser: %s", buf); +} + +int urlhack_is_ctrl_pressed() +{ + // TODO + return 1; +} + + +void rtfm(const char *error) +{ + // TODO +} + + + diff --git a/unix/uxstore.c b/unix/uxstore.c index 9d1015758..8ba515855 100644 --- a/unix/uxstore.c +++ b/unix/uxstore.c @@ -448,7 +448,10 @@ void del_settings(const char *sessionname) sfree(filename); } -void *enum_settings_start(void) +void set_storagetype(int storagetype_IGNORED) { +} + +void *enum_settings_start(int storagetype_IGNORED) { DIR *dp; char *filename; diff --git a/windows/re_lib/regexp.c b/windows/re_lib/regexp.c index 146578e6b..6df0a534e 100644 --- a/windows/re_lib/regexp.c +++ b/windows/re_lib/regexp.c @@ -174,15 +174,15 @@ STATIC void regoptail( char* p, char* val); STATIC int strcspn(); #endif -static void (*regerror_func)( char* s) = 0; +static void (*regerror_func)( const char* s) = 0; -void regerror( char* s) +void regerror( const char* s) { if( regerror_func) (*regerror_func)( s); } -void set_regerror_func( void (*func)( char*)) +void set_regerror_func( void (*func)( const char*)) { regerror_func = func; } @@ -208,7 +208,7 @@ regcomp( char* exp) register regexp *r; register char *scan; register char *longest; - register int len; + register size_t len; int flags; if (exp == NULL) @@ -294,7 +294,7 @@ reg( int paren, int* flagp) /* paren - Parenthesized? */ register char *ret; register char *br; register char *ender; - register int parno; + register int parno = 0; int flags; *flagp = HASWIDTH; /* Tentatively. */ diff --git a/windows/re_lib/regexp.h b/windows/re_lib/regexp.h index fe1348a60..1403c4bd3 100644 --- a/windows/re_lib/regexp.h +++ b/windows/re_lib/regexp.h @@ -11,7 +11,7 @@ typedef struct regexp { char regstart; /* Internal use only. */ char reganch; /* Internal use only. */ char *regmust; /* Internal use only. */ - int regmlen; /* Internal use only. */ + size_t regmlen; /* Internal use only. */ char program[1]; /* Unwarranted chumminess with compiler. */ } regexp; @@ -19,4 +19,4 @@ regexp *regcomp( char* re); int regexec( regexp* r, char* str); void regsub( regexp* r, char* str, char* substr); void regerror( char* s); /* for internal use only */ -void set_regerror_func( void (*func)( char*)); +void set_regerror_func( void (*func)( const char*)); diff --git a/windows/urlhack.h b/windows/urlhack.h index f36b5e6fb..f6e5d216e 100644 --- a/windows/urlhack.h +++ b/windows/urlhack.h @@ -21,6 +21,7 @@ void urlhack_add_link_region(int x0, int y0, int x1, int y1); void urlhack_launch_url(const char* app, const char *url); int urlhack_is_ctrl_pressed(); void urlhack_set_regular_expression(const char* expression); +void rtfm(const char *error); void urlhack_init(); void urlhack_cleanup();