summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2011-05-11 10:10:26 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2011-05-11 10:10:26 +0000
commit4369b0bd4e140cf2e78637ce3915445235d3c5bf (patch)
tree33599220b7d2f9af628048bdf7fe2614cc26949a /Build
parent6b3338587e25eb4940a381f8aade70f57d587826 (diff)
fix a SyncTeX bug in the case where --output-directory option is given.
git-svn-id: svn://tug.org/texlive/trunk@22423 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/web2c/lib/ChangeLog5
-rw-r--r--Build/source/texk/web2c/lib/texmfmp.c23
2 files changed, 28 insertions, 0 deletions
diff --git a/Build/source/texk/web2c/lib/ChangeLog b/Build/source/texk/web2c/lib/ChangeLog
index 0c95e98973e..f09819408d1 100644
--- a/Build/source/texk/web2c/lib/ChangeLog
+++ b/Build/source/texk/web2c/lib/ChangeLog
@@ -1,3 +1,8 @@
+2011-05-11 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
+
+ * texmfmp.c: add a function generic_synctex_get_current_name()
+ in order to get full path names for SyncTeX.
+
2011-05-04 Peter Breitenlohner <peb@mppmu.mpg.de>
* texmfmp.c (ipc_open_out): Avoid to #define SOCK_NONBLOCK which
diff --git a/Build/source/texk/web2c/lib/texmfmp.c b/Build/source/texk/web2c/lib/texmfmp.c
index c672ae10704..c97ee075b96 100644
--- a/Build/source/texk/web2c/lib/texmfmp.c
+++ b/Build/source/texk/web2c/lib/texmfmp.c
@@ -90,6 +90,29 @@
#define edit_var "MFEDIT"
#endif /* MF */
+#if defined(__SyncTeX__)
+/*
+ SyncTeX file name should be full path in the case where
+ --output-directory option is given.
+ Borrowed from LuaTeX.
+*/
+char *generic_synctex_get_current_name (void)
+{
+ char *pwdbuf = NULL, *ret;
+ int pwdbufsize = 2;
+ if (kpse_absolute_p(fullnameoffile, 0)) {
+ return xstrdup(fullnameoffile);
+ }
+ do {
+ pwdbufsize = 2*pwdbufsize;
+ pwdbuf = xrealloc (pwdbuf, pwdbufsize);
+ } while (!getcwd(pwdbuf, pwdbufsize));
+ ret = concat3(pwdbuf, DIR_SEP_STRING, fullnameoffile);
+ free(pwdbuf) ;
+ return ret;
+}
+#endif
+
/* Shell escape.
If shellenabledp == 0, all shell escapes are forbidden.