From 2c26c0f9de206e9cf531382ca58cbe509cdfeadf Mon Sep 17 00:00:00 2001
From: Luigi Scarso <luigi.scarso@gmail.com>
Date: Thu, 11 Dec 2014 10:09:30 +0000
Subject: [PATCH] sync with TL 35786

---
 source/texk/kpathsea/Makefile.in             | 2 +-
 source/texk/web2c/luatexdir/ChangeLog        | 9 +++++++++
 source/texk/web2c/luatexdir/font/mapfile.w   | 8 ++++----
 source/texk/web2c/luatexdir/font/tounicode.w | 4 ++--
 source/texk/web2c/luatexdir/font/writet1.w   | 4 ++--
 source/texk/web2c/luatexdir/font/writettf.w  | 2 +-
 source/texk/web2c/luatexdir/lang/texlang.w   | 4 ++--
 source/texk/web2c/luatexdir/pdf/pdfgen.w     | 2 +-
 source/texk/web2c/synctexdir/ChangeLog       | 4 ++++
 source/texk/web2c/synctexdir/synctex.c       | 2 +-
 10 files changed, 27 insertions(+), 14 deletions(-)

diff --git a/source/texk/kpathsea/Makefile.in b/source/texk/kpathsea/Makefile.in
index 56e5e28dd..7ecb5f0c7 100644
--- a/source/texk/kpathsea/Makefile.in
+++ b/source/texk/kpathsea/Makefile.in
@@ -110,7 +110,7 @@ DIST_COMMON = $(top_srcdir)/../../am/bin_links.am \
 	$(srcdir)/../../am/rebuild.am $(srcdir)/Makefile.in \
 	$(srcdir)/Makefile.am $(top_srcdir)/configure \
 	$(am__configure_deps) $(srcdir)/c-auto.in \
-	$(srcdir)/kpathsea.pc.in strcasecmp.c putenv.c strtol.c \
+	$(srcdir)/kpathsea.pc.in strtol.c putenv.c strcasecmp.c \
 	strstr.c $(dist_noinst_SCRIPTS) $(dist_web2c_SCRIPTS) \
 	$(top_srcdir)/../../build-aux/depcomp $(dist_noinst_DATA) \
 	$(dist_web2c_DATA) $(kpseinclude_HEADERS) $(noinst_HEADERS) \
diff --git a/source/texk/web2c/luatexdir/ChangeLog b/source/texk/web2c/luatexdir/ChangeLog
index 480045cdb..16350bc3d 100644
--- a/source/texk/web2c/luatexdir/ChangeLog
+++ b/source/texk/web2c/luatexdir/ChangeLog
@@ -1,3 +1,12 @@
+2014-12-10  Peter Breitenlohner  <peb@mppmu.mpg.de>
+
+	Sync with https://foundry.supelec.fr/svn/luatex/trunk/source/
+	                  texk/web2c/luatexdir/ r5092.
+
+2014-11-06  Peter Breitenlohner  <peb@mppmu.mpg.de>
+
+	* luatex.c: Avoid MinGW64 warnings (INVALID_SOCKET => -1).
+
 2014-11-03  Akira Kakuto  <kakuto@fuk.kindai.ac.jp>
 
 	* luatex.c: Indentation.
diff --git a/source/texk/web2c/luatexdir/font/mapfile.w b/source/texk/web2c/luatexdir/font/mapfile.w
index 19726cda1..dc79248e6 100644
--- a/source/texk/web2c/luatexdir/font/mapfile.w
+++ b/source/texk/web2c/luatexdir/font/mapfile.w
@@ -367,15 +367,15 @@ static void fm_scan_line(void)
     fm = new_fm_entry();
     read_field(r, q, buf);
     set_field(tfm_name);
-    if (!isdigit(*r)) {         /* 2nd field ps_name may not start with a digit */
+    if (!isdigit((unsigned char)*r)) {         /* 2nd field ps_name may not start with a digit */
         read_field(r, q, buf);
         set_field(ps_name);
     }
-    if (isdigit(*r)) {          /* font descriptor /Flags given? */
-        for (s = r; isdigit(*s); s++);
+    if (isdigit((unsigned char)*r)) {          /* font descriptor /Flags given? */
+        for (s = r; isdigit((unsigned char)*s); s++);
         if (*s == ' ' || *s == '"' || *s == '<' || *s == '\0') {        /* not e. g. 8r.enc */
             fm->fd_flags = atoi(r);
-            while (isdigit(*r))
+            while (isdigit((unsigned char)*r))
                 r++;
         }
     }
diff --git a/source/texk/web2c/luatexdir/font/tounicode.w b/source/texk/web2c/luatexdir/font/tounicode.w
index 587a824ee..7b32e96e9 100644
--- a/source/texk/web2c/luatexdir/font/tounicode.w
+++ b/source/texk/web2c/luatexdir/font/tounicode.w
@@ -92,7 +92,7 @@ void def_tounicode(str_number glyph, str_number unistr)
     for (i = 0; i < l; i++) {
         if (p[i] == ' ')
             valid_unistr = 2;   /* if a space occurs we treat this entry as a string */
-        else if (!isXdigit(p[i])) {
+        else if (!isXdigit((unsigned char)p[i])) {
             valid_unistr = 0;
             break;
         }
@@ -151,7 +151,7 @@ static long check_unicode_value(char *s, boolean multiple_value)
         return UNI_UNDEF;
 
     for (i = 0; i < l; i++) {
-        if (!isXdigit(s[i]))
+        if (!isXdigit((unsigned char)s[i]))
             return UNI_UNDEF;
         if (multiple_value) {
             if (i % 4 == 3) {
diff --git a/source/texk/web2c/luatexdir/font/writet1.w b/source/texk/web2c/luatexdir/font/writet1.w
index 2ffdcef12..dc8d8be4f 100644
--- a/source/texk/web2c/luatexdir/font/writet1.w
+++ b/source/texk/web2c/luatexdir/font/writet1.w
@@ -456,7 +456,7 @@ static float t1_scan_num(char *p, char **r)
         luatex_fail("a number expected: `%s'", t1_line_array);
     }
     if (r != NULL) {
-        for (; isdigit(*p) || *p == '.' ||
+        for (; isdigit((unsigned char)*p) || *p == '.' ||
              *p == 'e' || *p == 'E' || *p == '+' || *p == '-'; p++);
         *r = p;
     }
@@ -1522,7 +1522,7 @@ static void t1_flush_cs(PDF pdf, boolean is_subr)
     t1_line_ptr = t1_line_array;
     for (p = start_line; p - start_line < size_pos;)
         *t1_line_ptr++ = *p++;
-    while (isdigit(*p))
+    while (isdigit((unsigned char)*p))
         p++;
     sprintf(t1_line_ptr, "%u", count);
     strcat(t1_line_ptr, p);
diff --git a/source/texk/web2c/luatexdir/font/writettf.w b/source/texk/web2c/luatexdir/font/writettf.w
index e98d567c8..93205bd68 100644
--- a/source/texk/web2c/luatexdir/font/writettf.w
+++ b/source/texk/web2c/luatexdir/font/writettf.w
@@ -622,7 +622,7 @@ static char *strip_spaces_and_delims(char *s, int l)
     for (i = 0; i < l; s++, i++) {
         if (*s == '(' || *s == ')' || *s == '<' || *s == '>' ||
             *s == '[' || *s == ']' || *s == '{' || *s == '}' ||
-            *s == '/' || *s == '%' || isspace(*s))
+            *s == '/' || *s == '%' || isspace((unsigned char)*s))
             continue;
         *p++ = *s;
     }
diff --git a/source/texk/web2c/luatexdir/lang/texlang.w b/source/texk/web2c/luatexdir/lang/texlang.w
index a0e328926..70134ab9e 100644
--- a/source/texk/web2c/luatexdir/lang/texlang.w
+++ b/source/texk/web2c/luatexdir/lang/texlang.w
@@ -193,7 +193,7 @@ const char *clean_hyphenation(const char *buff, char **cleaned)
     char *uindex = (char *)word;
     const char *s = buff;
 
-    while (*s && !isspace(*s)) {
+    while (*s && !isspace((unsigned char)*s)) {
 	word[i++] = (unsigned)*s;
 	s++;
         if ((s-buff)>MAX_WORD_LEN) {
@@ -271,7 +271,7 @@ void load_hyphenation(struct tex_language *lang, const unsigned char *buff)
     lua_rawgeti(L, LUA_REGISTRYINDEX, lang->exceptions);
     s = (const char *) buff;
     while (*s) {
-        while (isspace(*s))
+        while (isspace((unsigned char)*s))
             s++;
         if (*s) {
             value = s;
diff --git a/source/texk/web2c/luatexdir/pdf/pdfgen.w b/source/texk/web2c/luatexdir/pdf/pdfgen.w
index 986150e89..d394ca787 100644
--- a/source/texk/web2c/luatexdir/pdf/pdfgen.w
+++ b/source/texk/web2c/luatexdir/pdf/pdfgen.w
@@ -621,7 +621,7 @@ void pdf_print_str(PDF pdf, const char *s)
         return;
     }
     s++;
-    while (is_hex_char(*s))
+    while (is_hex_char((unsigned char)*s))
         s++;
     if (s != orig + l) {
         pdf_out(pdf, '(');
diff --git a/source/texk/web2c/synctexdir/ChangeLog b/source/texk/web2c/synctexdir/ChangeLog
index 6afbeac7c..f1bda4c4a 100644
--- a/source/texk/web2c/synctexdir/ChangeLog
+++ b/source/texk/web2c/synctexdir/ChangeLog
@@ -1,3 +1,7 @@
+2014-12-10  Peter Breitenlohner  <peb@mppmu.mpg.de>
+
+	* synctex.c: Define SYNCTEX_YES as 1, not -1 (for bitfields).
+
 2014-08-04  Peter Breitenlohner  <peb@mppmu.mpg.de>
 
 	* synctex_parser.c: Declare functions with file scope as static.
diff --git a/source/texk/web2c/synctexdir/synctex.c b/source/texk/web2c/synctexdir/synctex.c
index bc52ed621..4b0eb09bb 100644
--- a/source/texk/web2c/synctexdir/synctex.c
+++ b/source/texk/web2c/synctexdir/synctex.c
@@ -330,7 +330,7 @@ mem[NODE+TYPE##_node_size-synchronization_field_size+1].cint
 
 #   include "synctex.h"
 
-#   define SYNCTEX_YES (-1)
+#   define SYNCTEX_YES (1)
 #   define SYNCTEX_NO  (0)
 #   define SYNCTEX_NO_ERROR  (0)
 
-- 
GitLab