mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2025-01-15 09:46:01 +01:00
Check if input_file is non-NULL
This commit is contained in:
parent
43139d88cd
commit
6efa1a2851
1 changed files with 12 additions and 10 deletions
|
@ -92,7 +92,7 @@ synctex_edit(const char* editor, zathura_page_t* page, int x, int y)
|
||||||
char* input_file = NULL;
|
char* input_file = NULL;
|
||||||
|
|
||||||
if (synctex_get_input_line_column(filename, zathura_page_get_index(page), x, y,
|
if (synctex_get_input_line_column(filename, zathura_page_get_index(page), x, y,
|
||||||
&input_file, &line, &column) == true) {
|
&input_file, &line, &column) == true && input_file != NULL) {
|
||||||
char* linestr = g_strdup_printf("%d", line);
|
char* linestr = g_strdup_printf("%d", line);
|
||||||
char* columnstr = g_strdup_printf("%d", column);
|
char* columnstr = g_strdup_printf("%d", column);
|
||||||
|
|
||||||
|
@ -100,14 +100,15 @@ synctex_edit(const char* editor, zathura_page_t* page, int x, int y)
|
||||||
gint argc = 0;
|
gint argc = 0;
|
||||||
if (g_shell_parse_argv(editor, &argc, &argv, NULL) == TRUE) {
|
if (g_shell_parse_argv(editor, &argc, &argv, NULL) == TRUE) {
|
||||||
for (gint i = 0; i != argc; ++i) {
|
for (gint i = 0; i != argc; ++i) {
|
||||||
char* temp = girara_replace_substring(argv[i], "%{line}", linestr);
|
char* arg = argv[i];
|
||||||
g_free(argv[i]);
|
char* temp = girara_replace_substring(arg, "%{line}", linestr);
|
||||||
argv[i] = temp;
|
g_free(arg);
|
||||||
temp = girara_replace_substring(argv[i], "%{column}", columnstr);
|
arg = temp;
|
||||||
g_free(argv[i]);
|
temp = girara_replace_substring(arg, "%{column}", columnstr);
|
||||||
argv[i] = temp;
|
g_free(arg);
|
||||||
temp = girara_replace_substring(argv[i], "%{input}", input_file);
|
arg = temp;
|
||||||
g_free(argv[i]);
|
temp = girara_replace_substring(arg, "%{input}", input_file);
|
||||||
|
g_free(arg);
|
||||||
argv[i] = temp;
|
argv[i] = temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,8 +122,9 @@ synctex_edit(const char* editor, zathura_page_t* page, int x, int y)
|
||||||
|
|
||||||
g_free(linestr);
|
g_free(linestr);
|
||||||
g_free(columnstr);
|
g_free(columnstr);
|
||||||
|
|
||||||
g_free(input_file);
|
g_free(input_file);
|
||||||
|
} else {
|
||||||
|
girara_warning("Failed to obtain data via SyncTeX or data is incomplete.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue