Commit a2a6a8e8 authored by Sebastian Ramacher's avatar Sebastian Ramacher

Be consistent

parent cac857cb
......@@ -162,7 +162,7 @@ girara_callback_view_key_press_event(GtkWidget* widget,
/* buffer could match a command */
if (!strncmp(session_private->buffer.command->str, shortcut->buffered_command, session_private->buffer.command->len)) {
/* command matches buffer exactly */
if (!strcmp(session_private->buffer.command->str, shortcut->buffered_command)
if (!g_strcmp0(session_private->buffer.command->str, shortcut->buffered_command)
&& (session->modes.current_mode == shortcut->mode || shortcut->mode == 0)) {
g_string_free(session_private->buffer.command, TRUE);
g_string_free(session->global.buffer, TRUE);
......
......@@ -199,8 +199,8 @@ girara_isc_completion(girara_session_t* session, girara_argument_t* argument, gi
* there is only one completion entry
*/
if ( (argument->n == GIRARA_HIDE) ||
(current_parameter && previous_parameter && strcmp(current_parameter, previous_parameter)) ||
(current_command && previous_command && strcmp(current_command, previous_command)) ||
(current_parameter && previous_parameter && g_strcmp0(current_parameter, previous_parameter)) ||
(current_command && previous_command && g_strcmp0(current_command, previous_command)) ||
(input_length != previous_length) ||
is_single_entry
)
......
......@@ -126,11 +126,11 @@ cb_scrollbars(girara_session_t* session, const char* name,
bool show_hscrollbar = strchr(guioptions, 'h') != NULL;
bool show_vscrollbar = strchr(guioptions, 'v') != NULL;
if (strcmp(name, "show-scrollbars") == 0) {
if (g_strcmp0(name, "show-scrollbars") == 0) {
show_hscrollbar = show_vscrollbar = val;
} else if (strcmp(name, "show-h-scrollbar") == 0) {
} else if (g_strcmp0(name, "show-h-scrollbar") == 0) {
show_hscrollbar = val;
} else if (strcmp(name, "show-v-scrollbar") == 0) {
} else if (g_strcmp0(name, "show-v-scrollbar") == 0) {
show_vscrollbar = val;
}
......@@ -289,7 +289,7 @@ girara_config_handle_add(girara_session_t* session, const char* identifier, gira
/* search for existing config handle */
GIRARA_LIST_FOREACH_BODY(session_private->config.handles, girara_config_handle_t*, data,
if (strcmp(data->identifier, identifier) == 0) {
if (g_strcmp0(data->identifier, identifier) == 0) {
data->handle = handle;
found = true;
break;
......@@ -364,7 +364,7 @@ config_parse(girara_session_t* session, const char* path)
}
/* include gets a special treatment */
if (strcmp(argv[0], "include") == 0) {
if (g_strcmp0(argv[0], "include") == 0) {
if (argc != 2) {
girara_warning("Could not process line %d in '%s': usage: include path.", line_number, path);
} else {
......@@ -379,7 +379,7 @@ config_parse(girara_session_t* session, const char* path)
g_free(basename);
}
if (strcmp(newpath, path) == 0) {
if (g_strcmp0(newpath, path) == 0) {
girara_warning("Could not process line %d in '%s': trying to include itself.", line_number, path);
} else {
girara_debug("Loading config file '%s'.", newpath);
......@@ -395,7 +395,7 @@ config_parse(girara_session_t* session, const char* path)
girara_config_handle_t* handle = NULL;
GIRARA_LIST_FOREACH_BODY(session_private->config.handles, girara_config_handle_t*, tmp,
handle = tmp;
if (strcmp(handle->identifier, argv[0]) == 0) {
if (g_strcmp0(handle->identifier, argv[0]) == 0) {
handle->handle(session, argument_list);
break;
} else {
......
......@@ -28,7 +28,7 @@ girara_shortcut_add(girara_session_t* session, guint modifier, guint key, const
bool found_existing_shortcut = false;
GIRARA_LIST_FOREACH_BODY_WITH_ITER(session->bindings.shortcuts, girara_shortcut_t*, iter, shortcuts_it,
if (((shortcuts_it->mask == modifier && shortcuts_it->key == key && (modifier != 0 || key != 0)) ||
(buffer && shortcuts_it->buffered_command && !strcmp(shortcuts_it->buffered_command, buffer)))
(buffer && shortcuts_it->buffered_command && !g_strcmp0(shortcuts_it->buffered_command, buffer)))
&& ((shortcuts_it->mode == mode) || (mode == 0)))
{
if (shortcuts_it->argument.data != NULL) {
......@@ -74,7 +74,7 @@ girara_shortcut_remove(girara_session_t* session, guint modifier, guint key, con
/* search for existing binding */
GIRARA_LIST_FOREACH_BODY(session->bindings.shortcuts, girara_shortcut_t*, shortcuts_it,
if (((shortcuts_it->mask == modifier && shortcuts_it->key == key && (modifier != 0 || key != 0)) ||
(buffer && shortcuts_it->buffered_command && !strcmp(shortcuts_it->buffered_command, buffer)))
(buffer && shortcuts_it->buffered_command && !g_strcmp0(shortcuts_it->buffered_command, buffer)))
&& shortcuts_it->mode == mode) {
girara_list_remove(session->bindings.shortcuts, shortcuts_it);
handled = true;
......@@ -594,7 +594,7 @@ girara_shortcut_mapping_add(girara_session_t* session, const char* identifier, g
bool found = false;
GIRARA_LIST_FOREACH_BODY(session_private->config.shortcut_mappings, girara_shortcut_mapping_t*, data,
if (strcmp(data->identifier, identifier) == 0) {
if (g_strcmp0(data->identifier, identifier) == 0) {
data->function = function;
found = true;
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment