Commit e6661bc6 authored by Sebastian Ramacher's avatar Sebastian Ramacher

Handle girara_replace_substring failures more gracefully

parent 6efa1a28
......@@ -102,14 +102,20 @@ synctex_edit(const char* editor, zathura_page_t* page, int x, int y)
for (gint i = 0; i != argc; ++i) {
char* arg = argv[i];
char* temp = girara_replace_substring(arg, "%{line}", linestr);
g_free(arg);
arg = temp;
temp = girara_replace_substring(arg, "%{column}", columnstr);
g_free(arg);
arg = temp;
temp = girara_replace_substring(arg, "%{input}", input_file);
g_free(arg);
argv[i] = temp;
arg = temp;
if (arg != NULL) {
g_free(argv[i]);
argv[i] = arg;
} else {
girara_error("Failed to update '%s' with line (%s), column (%s) and input file (%s) data.", argv[i], linestr, columnstr, input_file);
}
}
GError* error = NULL;
......
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