summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Carl <danielcarl@gmx.de>2018-06-02 22:11:09 +0200
committerDaniel Carl <danielcarl@gmx.de>2018-06-02 22:11:09 +0200
commit9e469c07cead0e033eb193f104bf7d65bd266ff4 (patch)
treee850678e962e943b96f6ba09522c1f073fe5e315 /src
parent8806b4919f0aba7f545d6cb601238178224dbe57 (diff)
Reuse success flag.
Diffstat (limited to 'src')
-rw-r--r--src/input.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/input.c b/src/input.c
index 66abfbc..02ad3f2 100644
--- a/src/input.c
+++ b/src/input.c
@@ -116,7 +116,7 @@ VbResult input_open_editor(Client *c)
const char *text = NULL, *id = NULL, *editor_command;
int argc;
GPid pid;
- gboolean success, idSuccess;
+ gboolean success;
GVariant *jsreturn;
GVariant *idreturn;
GError *error = NULL;
@@ -139,16 +139,16 @@ VbResult input_open_editor(Client *c)
}
idreturn = ext_proxy_eval_script_sync(c, "vimb_input_mode_element.id");
- g_variant_get(idreturn, "(bs)", &idSuccess, &id);
+ g_variant_get(idreturn, "(bs)", &success, &id);
/* Special case: the input element does not have an id assigned to it */
- if (!idSuccess || !id || strlen(id) == 0) {
+ if (!success || !*id) {
element_map_key = element_map_next_key++;
char *js_command = g_strdup_printf(JS_SET_EDITOR_MAP_ELEMENT, element_map_key);
ext_proxy_eval_script(c, js_command, NULL);
g_free(js_command);
} else {
- element_id = g_strdup(id);
+ element_id = g_strdup(id);
}
/* create a temp file to pass text to and from editor */
@@ -184,9 +184,9 @@ VbResult input_open_editor(Client *c)
/* watch the editor process */
EditorData *data = g_slice_new0(EditorData);
- data->file = file_path;
- data->c = c;
- data->element_id = element_id;
+ data->file = file_path;
+ data->c = c;
+ data->element_id = element_id;
data->element_map_key = element_map_key;
g_child_watch_add(pid, (GChildWatchFunc)resume_editor, data);