aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--AUTHORS2
-rw-r--r--uzbl.c9
-rw-r--r--uzblctrl.c4
3 files changed, 10 insertions, 5 deletions
diff --git a/AUTHORS b/AUTHORS
index 1873492..938bfa2 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -26,6 +26,8 @@ Contributors:
Maximilian Gaß (mxey) - small patches
Abel Camarillo (00z) - make it compile on OpenBSD
(israellevin) - toggle_zoom_type
+ (kmeaw) - fix for multibyte utf8 characters segfault
+ (evocallaghan) - tiny patches
Originaly based on http://trac.webkit.org/browser/trunk/WebKitTools/GtkLauncher/main.c
Which is copyrighted:
diff --git a/uzbl.c b/uzbl.c
index a596b0e..8ed8788 100644
--- a/uzbl.c
+++ b/uzbl.c
@@ -988,10 +988,13 @@ keycmd_nl (WebKitWebView *page, GArray *argv, GString *result) {
static void
keycmd_bs (WebKitWebView *page, GArray *argv, GString *result) {
+ gchar *prev;
(void)page;
(void)argv;
(void)result;
- g_string_truncate(uzbl.state.keycmd, uzbl.state.keycmd->len - 1);
+ prev = g_utf8_find_prev_char(uzbl.state.keycmd->str, uzbl.state.keycmd->str + uzbl.state.keycmd->len);
+ if (prev)
+ g_string_truncate(uzbl.state.keycmd, prev - uzbl.state.keycmd->str);
update_title();
}
@@ -1764,9 +1767,9 @@ parse_cmd_line(const char *ctl_line, GString *result) {
static gchar*
build_stream_name(int type, const gchar* dir) {
- char *xwin_str;
+ char *xwin_str = NULL;
State *s = &uzbl.state;
- gchar *str;
+ gchar *str = NULL;
xwin_str = itos((int)uzbl.xwin);
if (type == FIFO) {
diff --git a/uzblctrl.c b/uzblctrl.c
index a4fcf1d..93584bc 100644
--- a/uzblctrl.c
+++ b/uzblctrl.c
@@ -23,7 +23,7 @@ static GOptionEntry entries[] =
int
main(int argc, char* argv[]) {
GError *error = NULL;
- GOptionContext* context = g_option_context_new ("- utility for controlling and interacting with uzbl through its socket file"); //TODO: get stuff back from uzbl
+ GOptionContext* context = g_option_context_new ("- utility for controlling and interacting with uzbl through its socket file"); /* TODO: get stuff back from uzbl */
g_option_context_add_main_entries (context, entries, NULL);
g_option_context_add_group (context, gtk_get_option_group (TRUE));
g_option_context_parse (context, &argc, &argv, &error);
@@ -64,7 +64,7 @@ main(int argc, char* argv[]) {
return 0;
} else {
- puts ("Usage: uzblctrl -s /path/to/socket -c \"command\"");
+ fprintf(stderr, "Usage: uzblctrl -s /path/to/socket -c \"command\"");
return 1;
}
}