Use fullpath in for --syntex-forward

Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
Sebastian Ramacher 2013-12-27 20:40:06 +01:00
parent 2940be27f1
commit 81e75539b3

27
main.c
View file

@ -1,11 +1,17 @@
/* See LICENSE file for license and copyright information */ /* See LICENSE file for license and copyright information */
#define _BSD_SOURCE
#define _XOPEN_SOURCE 700
#include <errno.h>
#include <girara/utils.h>
#include <glib/gi18n.h>
#include <glib/gstdio.h>
#include <limits.h>
#include <locale.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <glib/gstdio.h> #include <string.h>
#include <glib/gi18n.h>
#include <girara/utils.h>
#include <locale.h>
#include <unistd.h> #include <unistd.h>
#include "zathura.h" #include "zathura.h"
@ -100,10 +106,19 @@ main(int argc, char* argv[])
return -1; return -1;
} }
if (synctex_forward_position(argv[1], synctex_fwd) == true) { char* real_path = realpath(argv[1], NULL);
if (real_path == NULL) {
girara_error("Failed to determine real path: %s", strerror(errno));
return -1;
}
const bool ret = synctex_forward_position(argv[1], synctex_fwd);
free(real_path);
if (ret == true) {
return 0; return 0;
} else { } else {
girara_error("Could not find open instance for '%s'", argv[1]); girara_error("Could not find open instance for '%s'", real_path);
return -1; return -1;
} }
} }