texlive[44052] Build/source/texk/web2c/synctexdir: SyncTeX: fixed

commits+jlaurens at tug.org commits+jlaurens at tug.org
Wed Apr 26 04:17:23 CEST 2017


Revision: 44052
          http://tug.org/svn/texlive?view=revision&revision=44052
Author:   jlaurens
Date:     2017-04-26 04:17:22 +0200 (Wed, 26 Apr 2017)
Log Message:
-----------
SyncTeX: fixed crash threat thanks to Akura Kakuto. Fixed newline bug on pdftex without breaking lualatex.

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/synctexdir/synctex-luatex.h
    trunk/Build/source/texk/web2c/synctexdir/synctex-pdftex.h
    trunk/Build/source/texk/web2c/synctexdir/synctex-tex.h
    trunk/Build/source/texk/web2c/synctexdir/synctex.c

Modified: trunk/Build/source/texk/web2c/synctexdir/synctex-luatex.h
===================================================================
--- trunk/Build/source/texk/web2c/synctexdir/synctex-luatex.h	2017-04-26 01:11:32 UTC (rev 44051)
+++ trunk/Build/source/texk/web2c/synctexdir/synctex-luatex.h	2017-04-26 02:17:22 UTC (rev 44052)
@@ -82,3 +82,6 @@
 /*   New LuaTeX (0.87.0) or later */
 #define glue_node 12
 #define kern_node 13
+
+#   define SYNCTEX_PRE_NL ""
+#   define SYNCTEX_POST_NL "\n"

Modified: trunk/Build/source/texk/web2c/synctexdir/synctex-pdftex.h
===================================================================
--- trunk/Build/source/texk/web2c/synctexdir/synctex-pdftex.h	2017-04-26 01:11:32 UTC (rev 44051)
+++ trunk/Build/source/texk/web2c/synctexdir/synctex-pdftex.h	2017-04-26 02:17:22 UTC (rev 44052)
@@ -69,3 +69,4 @@
 extern void synctexmrofxfdp();
 extern void synctexpdfrefxform(int objnum);
 
+#define SYNCTEX_interaction interaction

Modified: trunk/Build/source/texk/web2c/synctexdir/synctex-tex.h
===================================================================
--- trunk/Build/source/texk/web2c/synctexdir/synctex-tex.h	2017-04-26 01:11:32 UTC (rev 44051)
+++ trunk/Build/source/texk/web2c/synctexdir/synctex-tex.h	2017-04-26 02:17:22 UTC (rev 44052)
@@ -49,3 +49,4 @@
 */
 
 #include "texd.h"
+#define SYNCTEX_interaction interaction

Modified: trunk/Build/source/texk/web2c/synctexdir/synctex.c
===================================================================
--- trunk/Build/source/texk/web2c/synctexdir/synctex.c	2017-04-26 01:11:32 UTC (rev 44051)
+++ trunk/Build/source/texk/web2c/synctexdir/synctex.c	2017-04-26 02:17:22 UTC (rev 44052)
@@ -454,7 +454,6 @@
         SYNCTEX_VALUE = 0;
     } else {
         /*  the command line options are not ignored  */
-        synctex_options|=1;
         if (synctex_options < 0) {
             SYNCTEX_NO_GZ = SYNCTEX_YES;
             synctex_ctxt.options = -synctex_options;
@@ -462,6 +461,7 @@
             SYNCTEX_NO_GZ = SYNCTEX_NO;
             synctex_ctxt.options =  synctex_options;
         }
+        synctex_options|=1; /* Do it when positive */
         /*  Initialize the content of the \synctex primitive */
         SYNCTEX_VALUE = synctex_options;
     }
@@ -657,11 +657,6 @@
             tmp = NULL;
             strcat(the_busy_name, synctex_suffix);
             /*  Initialize SYNCTEX_NO_GZ with the content of \synctex to let the user choose the format. */
-#define SYNCTEX_GZ_LEN(WHAT)\
-(SYNCTEX_NO_GZ_AUX_NAME?0:strlen(WHAT))
-            if (!SYNCTEX_NO_GZ_AUX_NAME) {
-                strcat(the_busy_name, synctex_suffix_gz);
-            }
             strcat(the_busy_name, synctex_suffix_busy);
             if (SYNCTEX_NO_GZ) {
                 SYNCTEX_FILE = fopen(the_busy_name, FOPEN_W_MODE);
@@ -875,7 +870,7 @@
         the_real_syncname =
         xmalloc((unsigned)(strlen(tmp)
                            + strlen(synctex_suffix)
-                           + SYNCTEX_GZ_LEN(synctex_suffix_gz)
+                           + strlen(synctex_suffix_gz)
                            + 1));
         if (!the_real_syncname) {
             SYNCTEX_FREE(tmp);
@@ -927,17 +922,35 @@
                             tmp += strlen(output_directory) + strlen(DIR_SEP_STRING);
                         }
 #                       endif
+#ifndef SYNCTEX_interaction
+#   define SYNCTEX_interaction 1
+#endif
+                        if (SYNCTEX_interaction>0) {
 #ifdef W32UPTEXSYNCTEX
                         {
                         char *stmp = chgto_oem(tmp);
-                        printf((synctex_ctxt.flags.quoted ? "SyncTeX written on \"%s\"" : "\nSyncTeX written on %s.\n"),
+                        printf((synctex_ctxt.flags.quoted ? "SyncTeX written on \"%s\"\n" : "\nSyncTeX written on %s.\n"),
                                stmp);
                         free(stmp);
                         }
 #else
-                        printf((synctex_ctxt.flags.quoted ? "SyncTeX written on \"%s\"\n" : "SyncTeX written on %s.\n"),
+#ifndef SYNCTEX_PRE_NL
+#   define SYNCTEX_PRE_NL "\n"
+#endif
+#ifndef SYNCTEX_POST_NL
+#   define SYNCTEX_POST_NL ""
+#endif
+                        printf((synctex_ctxt.flags.quoted ?
+                                SYNCTEX_PRE_NL
+                                "SyncTeX written on \"%s\""
+                                SYNCTEX_POST_NL :
+                                SYNCTEX_PRE_NL
+                                "SyncTeX written on %s."
+                                SYNCTEX_POST_NL
+                                ),
                                tmp);
 #endif
+                        }
                         tmp = NULL;
                     }
                 } else {
@@ -969,7 +982,7 @@
         the_real_syncname = xmalloc((size_t)
                                     (len
                                      + strlen(synctex_suffix)
-                                     + SYNCTEX_GZ_LEN(synctex_suffix_gz)
+                                     + strlen(synctex_suffix_gz)
                                      + 1));
         if (!the_real_syncname) {
             SYNCTEX_FREE(tmp);



More information about the tex-live-commits mailing list