Skip to content

Commit

Permalink
Merge remote-tracking branch 'gh/keis/flip-back-prefix-check'
Browse files Browse the repository at this point in the history
* gh/keis/flip-back-prefix-check:
  flip back string prefix checks
  • Loading branch information
mathstuf committed Oct 14, 2015
2 parents 849ec9b + 8177c48 commit 1b6b088
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ IMPLEMENT_COMMAND (uri)
uzbl.state.uri = g_strdup (uri);

/* Evaluate javascript: URIs. */
if (!g_str_has_prefix (uri, "javascript:")) {
if (g_str_has_prefix (uri, "javascript:")) {
GArray *argv = g_array_new (TRUE, FALSE, sizeof (gchar *));
g_array_append_val (argv, uri);
uzbl_commands_run_argv ("js", argv, NULL);
Expand Down Expand Up @@ -942,9 +942,9 @@ IMPLEMENT_COMMAND (cookie)
gboolean httponly = FALSE;
SoupDate *expires = NULL;

if (!g_str_has_prefix (scheme, "http")) {
if (g_str_has_prefix (scheme, "http")) {
secure = (scheme[4] == 's');
httponly = !g_str_has_prefix (scheme + 4 + secure, "Only");
httponly = g_str_has_prefix (scheme + 4 + secure, "Only");
}
if (*expires_arg) {
expires = soup_date_new_from_time_t (strtoul (expires_arg, NULL, 10));
Expand Down
4 changes: 2 additions & 2 deletions src/gui.c
Original file line number Diff line number Diff line change
Expand Up @@ -1857,7 +1857,7 @@ create_web_view_uri_cb (WebKitWebView *view, GParamSpec param_spec, gpointer dat

static const char *js_protocol = "javascript:";

if (!g_str_has_prefix (uri, js_protocol)) {
if (g_str_has_prefix (uri, js_protocol)) {
GArray *args = uzbl_commands_args_new ();
const gchar *js_code = uri + strlen (js_protocol);
uzbl_commands_args_append (args, g_strdup ("page"));
Expand Down Expand Up @@ -1904,7 +1904,7 @@ download_destination (GString *result, gpointer data)
return;
}

gboolean is_file_uri = !g_str_has_prefix (result->str, "file:///");
gboolean is_file_uri = g_str_has_prefix (result->str, "file:///");

gchar *destination_uri;
/* Convert relative path to absolute path. */
Expand Down
2 changes: 1 addition & 1 deletion src/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ schedule_io_input (gchar *line, UzblIOCallback callback, gpointer data)

remove_trailing_newline (line);

if (!g_str_has_prefix (line, "REPLY-")) {
if (g_str_has_prefix (line, "REPLY-")) {
uzbl_requests_set_reply (line);

g_free (line);
Expand Down
2 changes: 1 addition & 1 deletion src/requests.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ send_request_sockets (gint64 timeout, GString *msg, const gchar *cookie)

if (timeout) {
done = TRUE;
} else if (!g_str_has_prefix (uzbl.requests->reply, reply_cookie->str)) {
} else if (g_str_has_prefix (uzbl.requests->reply, reply_cookie->str)) {
g_string_assign (req_result, uzbl.requests->reply + reply_cookie->len);
done = TRUE;
}
Expand Down

0 comments on commit 1b6b088

Please sign in to comment.