pdftex[806] branches/stable/source/src: sync with tl r48175

commits+karl at tug.org commits+karl at tug.org
Tue Jul 10 19:26:48 CEST 2018


Revision: 806
          http://tug.org/svn/pdftex?view=revision&revision=806
Author:   karl
Date:     2018-07-10 19:26:48 +0200 (Tue, 10 Jul 2018)
Log Message:
-----------
sync with tl r48175

Revision Links:
--------------
    http://tug.org/svn/pdftex?view=revision&revision=48175

Modified Paths:
--------------
    branches/stable/source/src/build-aux/config.guess
    branches/stable/source/src/build-aux/config.sub
    branches/stable/source/src/build-aux/texinfo.tex
    branches/stable/source/src/doc/build-tools.txt
    branches/stable/source/src/doc/tlbuild.info
    branches/stable/source/src/doc/tlbuild.texi
    branches/stable/source/src/libs/README
    branches/stable/source/src/libs/poppler/ChangeLog
    branches/stable/source/src/libs/poppler/Makefile.am
    branches/stable/source/src/libs/poppler/Makefile.in
    branches/stable/source/src/libs/poppler/TLpatches/ChangeLog
    branches/stable/source/src/libs/poppler/TLpatches/TL-Changes
    branches/stable/source/src/libs/poppler/TLpatches/patch-03-time
    branches/stable/source/src/libs/poppler/configure
    branches/stable/source/src/libs/poppler/poppler-src/CMakeLists.txt
    branches/stable/source/src/libs/poppler/poppler-src/ChangeLog
    branches/stable/source/src/libs/poppler/poppler-src/NEWS
    branches/stable/source/src/libs/poppler/poppler-src/fofi/FoFiIdentifier.cc
    branches/stable/source/src/libs/poppler/poppler-src/fofi/FoFiTrueType.cc
    branches/stable/source/src/libs/poppler/poppler-src/fofi/FoFiTrueType.h
    branches/stable/source/src/libs/poppler/poppler-src/fofi/FoFiType1.cc
    branches/stable/source/src/libs/poppler/poppler-src/fofi/FoFiType1C.cc
    branches/stable/source/src/libs/poppler/poppler-src/goo/GooString.h
    branches/stable/source/src/libs/poppler/poppler-src/goo/gmem.cc
    branches/stable/source/src/libs/poppler/poppler-src/poppler/Annot.cc
    branches/stable/source/src/libs/poppler/poppler-src/poppler/Annot.h
    branches/stable/source/src/libs/poppler/poppler-src/poppler/Array.cc
    branches/stable/source/src/libs/poppler/poppler-src/poppler/CMap.cc
    branches/stable/source/src/libs/poppler/poppler-src/poppler/CharCodeToUnicode.cc
    branches/stable/source/src/libs/poppler/poppler-src/poppler/CharCodeToUnicode.h
    branches/stable/source/src/libs/poppler/poppler-src/poppler/Decrypt.cc
    branches/stable/source/src/libs/poppler/poppler-src/poppler/Dict.cc
    branches/stable/source/src/libs/poppler/poppler-src/poppler/Form.cc
    branches/stable/source/src/libs/poppler/poppler-src/poppler/Form.h
    branches/stable/source/src/libs/poppler/poppler-src/poppler/Function.cc
    branches/stable/source/src/libs/poppler/poppler-src/poppler/Gfx.cc
    branches/stable/source/src/libs/poppler/poppler-src/poppler/GfxFont.cc
    branches/stable/source/src/libs/poppler/poppler-src/poppler/GfxState.cc
    branches/stable/source/src/libs/poppler/poppler-src/poppler/GfxState.h
    branches/stable/source/src/libs/poppler/poppler-src/poppler/GlobalParams.cc
    branches/stable/source/src/libs/poppler/poppler-src/poppler/GlobalParams.h
    branches/stable/source/src/libs/poppler/poppler-src/poppler/GlobalParamsWin.cc
    branches/stable/source/src/libs/poppler/poppler-src/poppler/Hints.cc
    branches/stable/source/src/libs/poppler/poppler-src/poppler/JBIG2Stream.cc
    branches/stable/source/src/libs/poppler/poppler-src/poppler/Lexer.cc
    branches/stable/source/src/libs/poppler/poppler-src/poppler/OutputDev.cc
    branches/stable/source/src/libs/poppler/poppler-src/poppler/OutputDev.h
    branches/stable/source/src/libs/poppler/poppler-src/poppler/PSOutputDev.cc
    branches/stable/source/src/libs/poppler/poppler-src/poppler/PSOutputDev.h
    branches/stable/source/src/libs/poppler/poppler-src/poppler/Parser.cc
    branches/stable/source/src/libs/poppler/poppler-src/poppler/ProfileData.cc
    branches/stable/source/src/libs/poppler/poppler-src/poppler/ProfileData.h
    branches/stable/source/src/libs/poppler/poppler-src/poppler/SecurityHandler.cc
    branches/stable/source/src/libs/poppler/poppler-src/poppler/SplashOutputDev.cc
    branches/stable/source/src/libs/poppler/poppler-src/poppler/Stream.cc
    branches/stable/source/src/libs/poppler/poppler-src/poppler/Stream.h
    branches/stable/source/src/libs/poppler/poppler-src/poppler/StructTreeRoot.cc
    branches/stable/source/src/libs/poppler/poppler-src/poppler/UnicodeMap.cc
    branches/stable/source/src/libs/poppler/poppler-src/poppler/UnicodeMap.h
    branches/stable/source/src/libs/poppler/poppler-src/poppler/XRef.cc
    branches/stable/source/src/libs/poppler/poppler-src/splash/SplashTypes.h
    branches/stable/source/src/libs/poppler/version.ac
    branches/stable/source/src/texk/README
    branches/stable/source/src/texk/kpathsea/ChangeLog
    branches/stable/source/src/texk/kpathsea/Makefile.am
    branches/stable/source/src/texk/kpathsea/Makefile.in
    branches/stable/source/src/texk/kpathsea/doc/kpathsea.info
    branches/stable/source/src/texk/kpathsea/doc/kpathsea.texi
    branches/stable/source/src/texk/kpathsea/knj.h
    branches/stable/source/src/texk/kpathsea/kpsewhich.c
    branches/stable/source/src/texk/kpathsea/progname.c
    branches/stable/source/src/texk/kpathsea/types.h
    branches/stable/source/src/texk/tests/TeXLive/TLConfig.pm
    branches/stable/source/src/texk/tests/TeXLive/TLUtils.pm
    branches/stable/source/src/texk/web2c/ChangeLog
    branches/stable/source/src/texk/web2c/Makefile.in
    branches/stable/source/src/texk/web2c/NEWS
    branches/stable/source/src/texk/web2c/am/web.am
    branches/stable/source/src/texk/web2c/cpascal.h
    branches/stable/source/src/texk/web2c/help.h
    branches/stable/source/src/texk/web2c/lib/ChangeLog
    branches/stable/source/src/texk/web2c/lib/openclose.c
    branches/stable/source/src/texk/web2c/lib/texmfmp.c
    branches/stable/source/src/texk/web2c/man/Makefile.in
    branches/stable/source/src/texk/web2c/pdftexdir/ChangeLog
    branches/stable/source/src/texk/web2c/pdftexdir/pdftoepdf.cc
    branches/stable/source/src/texk/web2c/pdftexdir/ptexlib.h
    branches/stable/source/src/texk/web2c/pdftexdir/writefont.c
    branches/stable/source/src/texk/web2c/synctexdir/ChangeLog
    branches/stable/source/src/texk/web2c/synctexdir/man1/synctex.1
    branches/stable/source/src/texk/web2c/texmfmp-help.h
    branches/stable/source/src/texk/web2c/web2c/ChangeLog
    branches/stable/source/src/texk/web2c/web2c/common.defines
    branches/stable/source/src/utils/README

Added Paths:
-----------
    branches/stable/source/src/texk/web2c/tests/auxinclude.bbl
    branches/stable/source/src/texk/web2c/tests/auxinclude.bib
    branches/stable/source/src/texk/web2c/tests/auxinclude.blg
    branches/stable/source/src/texk/web2c/tests/auxinclude.pdf
    branches/stable/source/src/texk/web2c/tests/auxinclude.tex
    branches/stable/source/src/texk/web2c/tests/auxinclude2.tex
    branches/stable/source/src/texk/web2c/tests/bibtex-auxinclude.test

Removed Paths:
-------------
    branches/stable/source/src/libs/poppler/poppler-src/goo/GooHash.cc
    branches/stable/source/src/libs/poppler/poppler-src/goo/GooHash.h

Modified: branches/stable/source/src/build-aux/config.guess
===================================================================
--- branches/stable/source/src/build-aux/config.guess	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/build-aux/config.guess	2018-07-10 17:26:48 UTC (rev 806)
@@ -2,7 +2,7 @@
 # Attempt to guess a canonical system name.
 #   Copyright 1992-2018 Free Software Foundation, Inc.
 
-timestamp='2018-03-08'
+timestamp='2018-07-06'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -101,12 +101,12 @@
 trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
 : ${TMPDIR=/tmp} ;
  { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp 2>/dev/null) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
  { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
 dummy=$tmp/dummy ;
 tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
+case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
  ,,)    echo "int x;" > "$dummy.c" ;
 	for c in cc gcc c89 c99 ; do
 	  if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
@@ -237,7 +237,7 @@
 	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
 	# contains redundant information, the shorter form:
 	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
-	echo "$machine-${os}${release}${abi}"
+	echo "$machine-${os}${release}${abi-}"
 	exit ;;
     *:Bitrig:*:*)
 	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
@@ -894,8 +894,8 @@
 	# other systems with GNU libc and userland
 	echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
 	exit ;;
-    i*86:Minix:*:*)
-	echo "$UNAME_MACHINE"-pc-minix
+    *:Minix:*:*)
+	echo "$UNAME_MACHINE"-unknown-minix
 	exit ;;
     aarch64:Linux:*:*)
 	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"

Modified: branches/stable/source/src/build-aux/config.sub
===================================================================
--- branches/stable/source/src/build-aux/config.sub	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/build-aux/config.sub	2018-07-10 17:26:48 UTC (rev 806)
@@ -2,7 +2,7 @@
 # Configuration validation subroutine script.
 #   Copyright 1992-2018 Free Software Foundation, Inc.
 
-timestamp='2018-05-14'
+timestamp='2018-07-03'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -149,119 +149,419 @@
 		esac
 		;;
 	*-*)
-		basic_machine=$field1
-		os=$field2
+		# Second component is usually, but not always the OS
+		case $field2 in
+			# Prevent following clause from handling this valid os
+			sun*os*)
+				basic_machine=$field1
+				os=$field2
+				;;
+			# Manufacturers
+			dec* | mips* | sequent* | encore* | pc532* | sgi* | sony* \
+			| att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
+			| unicom* | ibm* | next | hp | isi* | apollo | altos* \
+			| convergent* | ncr* | news | 32* | 3600* | 3100* | hitachi* \
+			| c[123]* | convex* | sun | crds | omron* | dg | ultra | tti* \
+			| harris | dolphin | highlevel | gould | cbm | ns | masscomp \
+			| apple | axis | knuth | cray | microblaze* \
+			| sim | cisco | oki | wec | wrs | winbond)
+				basic_machine=$field1-$field2
+				os=
+				;;
+			*)
+				basic_machine=$field1
+				os=$field2
+				;;
+		esac
 		;;
 	*)
-		basic_machine=$1
-		os=
+		# Convert single-component short-hands not valid as part of
+		# multi-component configurations.
+		case $field1 in
+			386bsd)
+				basic_machine=i386-pc
+				os=bsd
+				;;
+			a29khif)
+				basic_machine=a29k-amd
+				os=udi
+				;;
+			adobe68k)
+				basic_machine=m68010-adobe
+				os=scout
+				;;
+			am29k)
+				basic_machine=a29k-none
+				os=bsd
+				;;
+			amdahl)
+				basic_machine=580-amdahl
+				os=sysv
+				;;
+			amigaos | amigados)
+				basic_machine=m68k-unknown
+				os=amigaos
+				;;
+			amigaunix | amix)
+				basic_machine=m68k-unknown
+				os=sysv4
+				;;
+			apollo68)
+				basic_machine=m68k-apollo
+				os=sysv
+				;;
+			apollo68bsd)
+				basic_machine=m68k-apollo
+				os=bsd
+				;;
+			aros)
+				basic_machine=i386-pc
+				os=aros
+				;;
+			aux)
+				basic_machine=m68k-apple
+				os=aux
+				;;
+			balance)
+				basic_machine=ns32k-sequent
+				os=dynix
+				;;
+			blackfin)
+				basic_machine=bfin-unknown
+				os=linux
+				;;
+			cegcc)
+				basic_machine=arm-unknown
+				os=cegcc
+				;;
+			cray)
+				basic_machine=j90-cray
+				os=unicos
+				;;
+			craynv)
+				basic_machine=craynv-cray
+				os=unicosmp
+				;;
+			delta88)
+				basic_machine=m88k-motorola
+				os=sysv3
+				;;
+			dicos)
+				basic_machine=i686-pc
+				os=dicos
+				;;
+			djgpp)
+				basic_machine=i586-pc
+				os=msdosdjgpp
+				;;
+			ebmon29k)
+				basic_machine=a29k-amd
+				os=ebmon
+				;;
+			es1800 | OSE68k | ose68k | ose | OSE)
+				basic_machine=m68k-ericsson
+				os=ose
+				;;
+			gmicro)
+				basic_machine=tron-gmicro
+				os=sysv
+				;;
+			go32)
+				basic_machine=i386-pc
+				os=go32
+				;;
+			h8300hms)
+				basic_machine=h8300-hitachi
+				os=hms
+				;;
+			h8300xray)
+				basic_machine=h8300-hitachi
+				os=xray
+				;;
+			h8500hms)
+				basic_machine=h8500-hitachi
+				os=hms
+				;;
+			harris)
+				basic_machine=m88k-harris
+				os=sysv3
+				;;
+			hp300bsd)
+				basic_machine=m68k-hp
+				os=bsd
+				;;
+			hp300hpux)
+				basic_machine=m68k-hp
+				os=hpux
+				;;
+			hppaosf)
+				basic_machine=hppa1.1-hp
+				os=osf
+				;;
+			hppro)
+				basic_machine=hppa1.1-hp
+				os=proelf
+				;;
+			i386mach)
+				basic_machine=i386-mach
+				os=mach
+				;;
+			vsta)
+				basic_machine=i386-unknown
+				os=vsta
+				;;
+			isi68 | isi)
+				basic_machine=m68k-isi
+				os=sysv
+				;;
+			m68knommu)
+				basic_machine=m68k-unknown
+				os=linux
+				;;
+			magnum | m3230)
+				basic_machine=mips-mips
+				os=sysv
+				;;
+			merlin)
+				basic_machine=ns32k-utek
+				os=sysv
+				;;
+			mingw64)
+				basic_machine=x86_64-pc
+				os=mingw64
+				;;
+			mingw32)
+				basic_machine=i686-pc
+				os=mingw32
+				;;
+			mingw32ce)
+				basic_machine=arm-unknown
+				os=mingw32ce
+				;;
+			monitor)
+				basic_machine=m68k-rom68k
+				os=coff
+				;;
+			morphos)
+				basic_machine=powerpc-unknown
+				os=morphos
+				;;
+			moxiebox)
+				basic_machine=moxie-unknown
+				os=moxiebox
+				;;
+			msdos)
+				basic_machine=i386-pc
+				os=msdos
+				;;
+			msys)
+				basic_machine=i686-pc
+				os=msys
+				;;
+			mvs)
+				basic_machine=i370-ibm
+				os=mvs
+				;;
+			nacl)
+				basic_machine=le32-unknown
+				os=nacl
+				;;
+			ncr3000)
+				basic_machine=i486-ncr
+				os=sysv4
+				;;
+			netbsd386)
+				basic_machine=i386-unknown
+				os=netbsd
+				;;
+			netwinder)
+				basic_machine=armv4l-rebel
+				os=linux
+				;;
+			news | news700 | news800 | news900)
+				basic_machine=m68k-sony
+				os=newsos
+				;;
+			news1000)
+				basic_machine=m68030-sony
+				os=newsos
+				;;
+			necv70)
+				basic_machine=v70-nec
+				os=sysv
+				;;
+			nh3000)
+				basic_machine=m68k-harris
+				os=cxux
+				;;
+			nh[45]000)
+				basic_machine=m88k-harris
+				os=cxux
+				;;
+			nindy960)
+				basic_machine=i960-intel
+				os=nindy
+				;;
+			mon960)
+				basic_machine=i960-intel
+				os=mon960
+				;;
+			nonstopux)
+				basic_machine=mips-compaq
+				os=nonstopux
+				;;
+			os400)
+				basic_machine=powerpc-ibm
+				os=os400
+				;;
+			OSE68000 | ose68000)
+				basic_machine=m68000-ericsson
+				os=ose
+				;;
+			os68k)
+				basic_machine=m68k-none
+				os=os68k
+				;;
+			paragon)
+				basic_machine=i860-intel
+				os=osf
+				;;
+			parisc)
+				basic_machine=hppa-unknown
+				os=linux
+				;;
+			pw32)
+				basic_machine=i586-unknown
+				os=pw32
+				;;
+			rdos | rdos64)
+				basic_machine=x86_64-pc
+				os=rdos
+				;;
+			rdos32)
+				basic_machine=i386-pc
+				os=rdos
+				;;
+			rom68k)
+				basic_machine=m68k-rom68k
+				os=coff
+				;;
+			sa29200)
+				basic_machine=a29k-amd
+				os=udi
+				;;
+			sei)
+				basic_machine=mips-sei
+				os=seiux
+				;;
+			sps7)
+				basic_machine=m68k-bull
+				os=sysv2
+				;;
+			stratus)
+				basic_machine=i860-stratus
+				os=sysv4
+				;;
+			sun2os3)
+				basic_machine=m68000-sun
+				os=sunos3
+				;;
+			sun2os4)
+				basic_machine=m68000-sun
+				os=sunos4
+				;;
+			sun3os3)
+				basic_machine=m68k-sun
+				os=sunos3
+				;;
+			sun3os4)
+				basic_machine=m68k-sun
+				os=sunos4
+				;;
+			sun4os3)
+				basic_machine=sparc-sun
+				os=sunos3
+				;;
+			sun4os4)
+				basic_machine=sparc-sun
+				os=sunos4
+				;;
+			sun4sol2)
+				basic_machine=sparc-sun
+				os=solaris2
+				;;
+			sv1)
+				basic_machine=sv1-cray
+				os=unicos
+				;;
+			symmetry)
+				basic_machine=i386-sequent
+				os=dynix
+				;;
+			t3e)
+				basic_machine=alphaev5-cray
+				os=unicos
+				;;
+			t90)
+				basic_machine=t90-cray
+				os=unicos
+				;;
+			toad1)
+				basic_machine=pdp10-xkl
+				os=tops20
+				;;
+			tpf)
+				basic_machine=s390x-ibm
+				os=tpf
+				;;
+			udi29k)
+				basic_machine=a29k-amd
+				os=udi
+				;;
+			ultra3)
+				basic_machine=a29k-nyu
+				os=sym1
+				;;
+			v810 | necv810)
+				basic_machine=v810-nec
+				os=none
+				;;
+			vaxv)
+				basic_machine=vax-dec
+				os=sysv
+				;;
+			vms)
+				basic_machine=vax-dec
+				os=vms
+				;;
+			vxworks960)
+				basic_machine=i960-wrs
+				os=vxworks
+				;;
+			vxworks68)
+				basic_machine=m68k-wrs
+				os=vxworks
+				;;
+			vxworks29k)
+				basic_machine=a29k-wrs
+				os=vxworks
+				;;
+			xbox)
+				basic_machine=i686-pc
+				os=mingw32
+				;;
+			ymp)
+				basic_machine=ymp-cray
+				os=unicos
+				;;
+			*)
+				basic_machine=$1
+				os=
+				;;
+		esac
 		;;
 esac
 
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work.  We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
-	sun*os*)
-		# Prevent following clause from handling this invalid input.
-		;;
-	dec* | mips* | sequent* | encore* | pc532* | sgi* | sony* | \
-	att* | 7300* | 3300* | delta* | motorola* | sun[234]* | \
-	unicom* | ibm* | next | hp | isi* | apollo | altos* | \
-	convergent* | ncr* | news | 32* | 3600* | 3100* | hitachi* |\
-	c[123]* | convex* | sun | crds | omron* | dg | ultra | tti* | \
-	harris | dolphin | highlevel | gould | cbm | ns | masscomp | \
-	apple | axis | knuth | cray | microblaze*)
-		os=
-		basic_machine=$1
-		;;
-	bluegene*)
-		os=cnk
-		;;
-	sim | cisco | oki | wec | winbond)
-		os=
-		basic_machine=$1
-		;;
-	scout)
-		;;
-	wrs)
-		os=vxworks
-		basic_machine=$1
-		;;
-	chorusos*)
-		os=chorusos
-		basic_machine=$1
-		;;
-	chorusrdb)
-		os=chorusrdb
-		basic_machine=$1
-		;;
-	hiux*)
-		os=hiuxwe2
-		;;
-	sco6)
-		os=sco5v6
-		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
-		;;
-	sco5)
-		os=sco3.2v5
-		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
-		;;
-	sco4)
-		os=sco3.2v4
-		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
-		;;
-	sco3.2.[4-9]*)
-		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
-		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
-		;;
-	sco3.2v[4-9]*)
-		# Don't forget version if it is 3.2v4 or newer.
-		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
-		;;
-	sco5v6*)
-		# Don't forget version if it is 3.2v4 or newer.
-		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
-		;;
-	sco*)
-		os=sco3.2v2
-		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
-		;;
-	udk*)
-		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
-		;;
-	isc)
-		os=isc2.2
-		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
-		;;
-	clix*)
-		basic_machine=clipper-intergraph
-		;;
-	isc*)
-		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
-		;;
-	lynx*178)
-		os=lynxos178
-		;;
-	lynx*5)
-		os=lynxos5
-		;;
-	lynx*)
-		os=lynxos
-		;;
-	ptx*)
-		basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'`
-		;;
-	psos*)
-		os=psos
-		;;
-	mint | mint[0-9]*)
-		basic_machine=m68k-atari
-		os=mint
-		;;
-esac
-
 # Decode aliases for certain CPU-COMPANY combinations.
 case $basic_machine in
 	# Recognize the basic CPU types without company name.
@@ -325,7 +625,7 @@
 	| powerpc | powerpc64 | powerpc64le | powerpcle \
 	| pru \
 	| pyramid \
-	| riscv32 | riscv64 \
+	| riscv | riscv32 | riscv64 \
 	| rl78 | rx \
 	| score \
 	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
@@ -356,24 +656,23 @@
 		;;
 	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
 		basic_machine=$basic_machine-unknown
-		os=none
+		os=${os:-none}
 		;;
 	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65)
 		;;
 	m9s12z | m68hcs12z | hcs12z | s12z)
 		basic_machine=s12z-unknown
-		os=none
+		os=${os:-none}
 		;;
 	ms1)
 		basic_machine=mt-unknown
 		;;
-
 	strongarm | thumb | xscale)
 		basic_machine=arm-unknown
 		;;
 	xgate)
 		basic_machine=$basic_machine-unknown
-		os=none
+		os=${os:-none}
 		;;
 	xscaleeb)
 		basic_machine=armeb-unknown
@@ -453,7 +752,7 @@
 	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
 	| pru-* \
 	| pyramid-* \
-	| riscv32-* | riscv64-* \
+	| riscv-* | riscv32-* | riscv64-* \
 	| rl78-* | romp-* | rs6000-* | rx-* \
 	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
 	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
@@ -481,10 +780,6 @@
 		;;
 	# Recognize the various machine names and aliases which stand
 	# for a CPU type and a company and sometimes even an OS.
-	386bsd)
-		basic_machine=i386-pc
-		os=bsd
-		;;
 	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
 		basic_machine=m68000-att
 		;;
@@ -491,17 +786,9 @@
 	3b*)
 		basic_machine=we32k-att
 		;;
-	a29khif)
-		basic_machine=a29k-amd
-		os=udi
-		;;
 	abacus)
 		basic_machine=abacus-unknown
 		;;
-	adobe68k)
-		basic_machine=m68010-adobe
-		os=scout
-		;;
 	alliant | fx80)
 		basic_machine=fx80-alliant
 		;;
@@ -508,10 +795,6 @@
 	altos | altos3068)
 		basic_machine=m68k-altos
 		;;
-	am29k)
-		basic_machine=a29k-none
-		os=bsd
-		;;
 	amd64)
 		basic_machine=x86_64-pc
 		;;
@@ -518,48 +801,12 @@
 	amd64-*)
 		basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
 		;;
-	amdahl)
-		basic_machine=580-amdahl
-		os=sysv
-		;;
 	amiga | amiga-*)
 		basic_machine=m68k-unknown
 		;;
-	amigaos | amigados)
-		basic_machine=m68k-unknown
-		os=amigaos
-		;;
-	amigaunix | amix)
-		basic_machine=m68k-unknown
-		os=sysv4
-		;;
-	apollo68)
-		basic_machine=m68k-apollo
-		os=sysv
-		;;
-	apollo68bsd)
-		basic_machine=m68k-apollo
-		os=bsd
-		;;
-	aros)
-		basic_machine=i386-pc
-		os=aros
-		;;
 	asmjs)
 		basic_machine=asmjs-unknown
 		;;
-	aux)
-		basic_machine=m68k-apple
-		os=aux
-		;;
-	balance)
-		basic_machine=ns32k-sequent
-		os=dynix
-		;;
-	blackfin)
-		basic_machine=bfin-unknown
-		os=linux
-		;;
 	blackfin-*)
 		basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'`
 		os=linux
@@ -579,12 +826,8 @@
 		;;
 	c90)
 		basic_machine=c90-cray
-		os=unicos
+		os=${os:-unicos}
 		;;
-	cegcc)
-		basic_machine=arm-unknown
-		os=cegcc
-		;;
 	convex-c1)
 		basic_machine=c1-convex
 		os=bsd
@@ -605,17 +848,9 @@
 		basic_machine=c38-convex
 		os=bsd
 		;;
-	cray | j90)
-		basic_machine=j90-cray
-		os=unicos
-		;;
-	craynv)
-		basic_machine=craynv-cray
-		os=unicosmp
-		;;
 	cr16 | cr16-*)
 		basic_machine=cr16-unknown
-		os=elf
+		os=${os:-elf}
 		;;
 	crds | unos)
 		basic_machine=m68k-crds
@@ -628,7 +863,7 @@
 		;;
 	crx)
 		basic_machine=crx-unknown
-		os=elf
+		os=${os:-elf}
 		;;
 	da30 | da30-*)
 		basic_machine=m68k-da30
@@ -648,21 +883,9 @@
 	      | 3300-motorola | delta-motorola)
 		basic_machine=m68k-motorola
 		;;
-	delta88)
-		basic_machine=m88k-motorola
-		os=sysv3
-		;;
-	dicos)
-		basic_machine=i686-pc
-		os=dicos
-		;;
-	djgpp)
-		basic_machine=i586-pc
-		os=msdosdjgpp
-		;;
 	dpx20 | dpx20-*)
 		basic_machine=rs6000-bull
-		os=bosx
+		os=${os:-bosx}
 		;;
 	dpx2*)
 		basic_machine=m68k-bull
@@ -676,21 +899,13 @@
 		basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
 		os=$os"spe"
 		;;
-	ebmon29k)
-		basic_machine=a29k-amd
-		os=ebmon
+	encore | umax | mmax)
+		basic_machine=ns32k-encore
 		;;
 	elxsi)
 		basic_machine=elxsi-elxsi
-		os=bsd
+		os=${os:-bsd}
 		;;
-	encore | umax | mmax)
-		basic_machine=ns32k-encore
-		;;
-	es1800 | OSE68k | ose68k | ose | OSE)
-		basic_machine=m68k-ericsson
-		os=ose
-		;;
 	fx2800)
 		basic_machine=i860-alliant
 		;;
@@ -697,45 +912,13 @@
 	genix)
 		basic_machine=ns32k-ns
 		;;
-	gmicro)
-		basic_machine=tron-gmicro
-		os=sysv
-		;;
-	go32)
-		basic_machine=i386-pc
-		os=go32
-		;;
 	h3050r* | hiux*)
 		basic_machine=hppa1.1-hitachi
 		os=hiuxwe2
 		;;
-	h8300hms)
-		basic_machine=h8300-hitachi
-		os=hms
-		;;
-	h8300xray)
-		basic_machine=h8300-hitachi
-		os=xray
-		;;
-	h8500hms)
-		basic_machine=h8500-hitachi
-		os=hms
-		;;
-	harris)
-		basic_machine=m88k-harris
-		os=sysv3
-		;;
 	hp300-*)
 		basic_machine=m68k-hp
 		;;
-	hp300bsd)
-		basic_machine=m68k-hp
-		os=bsd
-		;;
-	hp300hpux)
-		basic_machine=m68k-hp
-		os=hpux
-		;;
 	hp3k9[0-9][0-9] | hp9[0-9][0-9])
 		basic_machine=hppa1.0-hp
 		;;
@@ -765,14 +948,6 @@
 	hp9k8[0-9][0-9] | hp8[0-9][0-9])
 		basic_machine=hppa1.0-hp
 		;;
-	hppaosf)
-		basic_machine=hppa1.1-hp
-		os=osf
-		;;
-	hppro)
-		basic_machine=hppa1.1-hp
-		os=proelf
-		;;
 	i370-ibm* | ibm*)
 		basic_machine=i370-ibm
 		;;
@@ -792,14 +967,10 @@
 		basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
 		os=solaris2
 		;;
-	i386mach)
-		basic_machine=i386-mach
-		os=mach
+	j90 | j90-cray)
+		basic_machine=j90-cray
+		os=${os:-unicos}
 		;;
-	vsta)
-		basic_machine=i386-unknown
-		os=vsta
-		;;
 	iris | iris4d)
 		basic_machine=mips-sgi
 		case $os in
@@ -810,44 +981,16 @@
 			;;
 		esac
 		;;
-	isi68 | isi)
-		basic_machine=m68k-isi
-		os=sysv
-		;;
 	leon-*|leon[3-9]-*)
 		basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'`
 		;;
-	m68knommu)
-		basic_machine=m68k-unknown
-		os=linux
-		;;
 	m68knommu-*)
 		basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'`
 		os=linux
 		;;
-	magnum | m3230)
-		basic_machine=mips-mips
-		os=sysv
-		;;
-	merlin)
-		basic_machine=ns32k-utek
-		os=sysv
-		;;
 	microblaze*)
 		basic_machine=microblaze-xilinx
 		;;
-	mingw64)
-		basic_machine=x86_64-pc
-		os=mingw64
-		;;
-	mingw32)
-		basic_machine=i686-pc
-		os=mingw32
-		;;
-	mingw32ce)
-		basic_machine=arm-unknown
-		os=mingw32ce
-		;;
 	miniframe)
 		basic_machine=m68000-convergent
 		;;
@@ -861,65 +1004,13 @@
 	mips3*)
 		basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown
 		;;
-	monitor)
-		basic_machine=m68k-rom68k
-		os=coff
-		;;
-	morphos)
-		basic_machine=powerpc-unknown
-		os=morphos
-		;;
-	moxiebox)
-		basic_machine=moxie-unknown
-		os=moxiebox
-		;;
-	msdos)
-		basic_machine=i386-pc
-		os=msdos
-		;;
 	ms1-*)
 		basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'`
 		;;
-	msys)
-		basic_machine=i686-pc
-		os=msys
-		;;
-	mvs)
-		basic_machine=i370-ibm
-		os=mvs
-		;;
-	nacl)
-		basic_machine=le32-unknown
-		os=nacl
-		;;
-	ncr3000)
-		basic_machine=i486-ncr
-		os=sysv4
-		;;
-	netbsd386)
-		basic_machine=i386-unknown
-		os=netbsd
-		;;
-	netwinder)
-		basic_machine=armv4l-rebel
-		os=linux
-		;;
-	news | news700 | news800 | news900)
-		basic_machine=m68k-sony
-		os=newsos
-		;;
-	news1000)
-		basic_machine=m68030-sony
-		os=newsos
-		;;
 	news-3600 | risc-news)
 		basic_machine=mips-sony
 		os=newsos
 		;;
-	necv70)
-		basic_machine=v70-nec
-		os=sysv
-		;;
 	next | m*-next)
 		basic_machine=m68k-next
 		case $os in
@@ -933,26 +1024,6 @@
 			;;
 		esac
 		;;
-	nh3000)
-		basic_machine=m68k-harris
-		os=cxux
-		;;
-	nh[45]000)
-		basic_machine=m88k-harris
-		os=cxux
-		;;
-	nindy960)
-		basic_machine=i960-intel
-		os=nindy
-		;;
-	mon960)
-		basic_machine=i960-intel
-		os=mon960
-		;;
-	nonstopux)
-		basic_machine=mips-compaq
-		os=nonstopux
-		;;
 	np1)
 		basic_machine=np1-gould
 		;;
@@ -978,30 +1049,10 @@
 	openrisc | openrisc-*)
 		basic_machine=or32-unknown
 		;;
-	os400)
-		basic_machine=powerpc-ibm
-		os=os400
-		;;
-	OSE68000 | ose68000)
-		basic_machine=m68000-ericsson
-		os=ose
-		;;
-	os68k)
-		basic_machine=m68k-none
-		os=os68k
-		;;
 	pa-hitachi)
 		basic_machine=hppa1.1-hitachi
 		os=hiuxwe2
 		;;
-	paragon)
-		basic_machine=i860-intel
-		os=osf
-		;;
-	parisc)
-		basic_machine=hppa-unknown
-		os=linux
-		;;
 	parisc-*)
 		basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'`
 		os=linux
@@ -1074,22 +1125,6 @@
 	ps2)
 		basic_machine=i386-ibm
 		;;
-	pw32)
-		basic_machine=i586-unknown
-		os=pw32
-		;;
-	rdos | rdos64)
-		basic_machine=x86_64-pc
-		os=rdos
-		;;
-	rdos32)
-		basic_machine=i386-pc
-		os=rdos
-		;;
-	rom68k)
-		basic_machine=m68k-rom68k
-		os=coff
-		;;
 	rm[46]00)
 		basic_machine=mips-siemens
 		;;
@@ -1102,10 +1137,6 @@
 	s390x | s390x-*)
 		basic_machine=s390x-ibm
 		;;
-	sa29200)
-		basic_machine=a29k-amd
-		os=udi
-		;;
 	sb1)
 		basic_machine=mipsisa64sb1-unknown
 		;;
@@ -1114,12 +1145,8 @@
 		;;
 	sde)
 		basic_machine=mipsisa32-sde
-		os=elf
+		os=${os:-elf}
 		;;
-	sei)
-		basic_machine=mips-sei
-		os=seiux
-		;;
 	sequent)
 		basic_machine=i386-sequent
 		;;
@@ -1130,10 +1157,6 @@
 		basic_machine=sparclite-wrs
 		os=vxworks
 		;;
-	sps7)
-		basic_machine=m68k-bull
-		os=sysv2
-		;;
 	spur)
 		basic_machine=spur-unknown
 		;;
@@ -1140,10 +1163,6 @@
 	st2000)
 		basic_machine=m68k-tandem
 		;;
-	stratus)
-		basic_machine=i860-stratus
-		os=sysv4
-		;;
 	strongarm-* | thumb-*)
 		basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'`
 		;;
@@ -1150,34 +1169,6 @@
 	sun2)
 		basic_machine=m68000-sun
 		;;
-	sun2os3)
-		basic_machine=m68000-sun
-		os=sunos3
-		;;
-	sun2os4)
-		basic_machine=m68000-sun
-		os=sunos4
-		;;
-	sun3os3)
-		basic_machine=m68k-sun
-		os=sunos3
-		;;
-	sun3os4)
-		basic_machine=m68k-sun
-		os=sunos4
-		;;
-	sun4os3)
-		basic_machine=sparc-sun
-		os=sunos3
-		;;
-	sun4os4)
-		basic_machine=sparc-sun
-		os=sunos4
-		;;
-	sun4sol2)
-		basic_machine=sparc-sun
-		os=solaris2
-		;;
 	sun3 | sun3-*)
 		basic_machine=m68k-sun
 		;;
@@ -1187,22 +1178,6 @@
 	sun386 | sun386i | roadrunner)
 		basic_machine=i386-sun
 		;;
-	sv1)
-		basic_machine=sv1-cray
-		os=unicos
-		;;
-	symmetry)
-		basic_machine=i386-sequent
-		os=dynix
-		;;
-	t3e)
-		basic_machine=alphaev5-cray
-		os=unicos
-		;;
-	t90)
-		basic_machine=t90-cray
-		os=unicos
-		;;
 	tile*)
 		basic_machine=$basic_machine-unknown
 		os=linux-gnu
@@ -1213,52 +1188,12 @@
 	tx39el)
 		basic_machine=mipstx39el-unknown
 		;;
-	toad1)
-		basic_machine=pdp10-xkl
-		os=tops20
-		;;
 	tower | tower-32)
 		basic_machine=m68k-ncr
 		;;
-	tpf)
-		basic_machine=s390x-ibm
-		os=tpf
-		;;
-	udi29k)
-		basic_machine=a29k-amd
-		os=udi
-		;;
-	ultra3)
-		basic_machine=a29k-nyu
-		os=sym1
-		;;
-	v810 | necv810)
-		basic_machine=v810-nec
-		os=none
-		;;
-	vaxv)
-		basic_machine=vax-dec
-		os=sysv
-		;;
-	vms)
-		basic_machine=vax-dec
-		os=vms
-		;;
 	vpp*|vx|vx-*)
 		basic_machine=f301-fujitsu
 		;;
-	vxworks960)
-		basic_machine=i960-wrs
-		os=vxworks
-		;;
-	vxworks68)
-		basic_machine=m68k-wrs
-		os=vxworks
-		;;
-	vxworks29k)
-		basic_machine=a29k-wrs
-		os=vxworks
-		;;
 	w65*)
 		basic_machine=w65-wdc
 		os=none
@@ -1270,10 +1205,6 @@
 	x64)
 		basic_machine=x86_64-pc
 		;;
-	xbox)
-		basic_machine=i686-pc
-		os=mingw32
-		;;
 	xps | xps100)
 		basic_machine=xps100-honeywell
 		;;
@@ -1280,13 +1211,9 @@
 	xscale-* | xscalee[bl]-*)
 		basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'`
 		;;
-	ymp)
-		basic_machine=ymp-cray
-		os=unicos
-		;;
 	none)
 		basic_machine=none-none
-		os=none
+		os=${os:-none}
 		;;
 
 # Here we handle the default manufacturer of certain CPU types.  It is in
@@ -1368,6 +1295,9 @@
 	auroraux)
 		os=auroraux
 		;;
+	bluegene*)
+		os=cnk
+		;;
 	solaris1 | solaris1.*)
 		os=`echo $os | sed -e 's|solaris1|sunos4|'`
 		;;
@@ -1384,12 +1314,43 @@
 	es1800*)
 		os=ose
 		;;
+	# Some version numbers need modification
+	chorusos*)
+		os=chorusos
+		;;
+	isc)
+		os=isc2.2
+		;;
+	sco6)
+		os=sco5v6
+		;;
+	sco5)
+		os=sco3.2v5
+		;;
+	sco4)
+		os=sco3.2v4
+		;;
+	sco3.2.[4-9]*)
+		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+		;;
+	sco3.2v[4-9]* | sco5v6*)
+		# Don't forget version if it is 3.2v4 or newer.
+		;;
+	scout)
+		# Don't match below
+		;;
+	sco*)
+		os=sco3.2v2
+		;;
+	psos*)
+		os=psos
+		;;
 	# Now accept the basic system types.
 	# The portable systems comes first.
 	# Each alternative MUST end in a * to match a version number.
 	# sysv* is not here because it comes later, after sysvr4.
 	gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
-	     | *vms* | sco* | esix* | isc* | aix* | cnk* | sunos | sunos[34]*\
+	     | *vms* | esix* | aix* | cnk* | sunos | sunos[34]*\
 	     | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
 	     | sym* | kopensolaris* | plan9* \
 	     | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
@@ -1396,14 +1357,14 @@
 	     | aos* | aros* | cloudabi* | sortix* \
 	     | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
 	     | clix* | riscos* | uniplus* | iris* | rtu* | xenix* \
-	     | hiux* | knetbsd* | mirbsd* | netbsd* \
+	     | knetbsd* | mirbsd* | netbsd* \
 	     | bitrig* | openbsd* | solidbsd* | libertybsd* \
 	     | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \
 	     | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
 	     | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
 	     | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \
-	     | chorusos* | chorusrdb* | cegcc* | glidix* \
-	     | cygwin* | msys* | pe* | psos* | moss* | proelf* | rtems* \
+	     | chorusrdb* | cegcc* | glidix* \
+	     | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
 	     | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \
 	     | linux-newlib* | linux-musl* | linux-uclibc* \
 	     | uxpv* | beos* | mpeix* | udk* | moxiebox* \
@@ -1427,6 +1388,9 @@
 			;;
 		esac
 		;;
+	hiux*)
+		os=hiuxwe2
+		;;
 	nto-qnx*)
 		;;
 	nto*)
@@ -1436,9 +1400,6 @@
 	    | windows* | osx | abug | netware* | os9* \
 	    | macos* | mpw* | magic* | mmixware* | mon960* | lnews*)
 		;;
-	mac*)
-		os=`echo "$os" | sed -e 's|mac|macos|'`
-		;;
 	linux-dietlibc)
 		os=linux-dietlibc
 		;;
@@ -1445,12 +1406,18 @@
 	linux*)
 		os=`echo $os | sed -e 's|linux|linux-gnu|'`
 		;;
-	sunos5*)
-		os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
+	lynx*178)
+		os=lynxos178
 		;;
-	sunos6*)
-		os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
+	lynx*5)
+		os=lynxos5
 		;;
+	lynx*)
+		os=lynxos
+		;;
+	mac*)
+		os=`echo "$os" | sed -e 's|mac|macos|'`
+		;;
 	opened*)
 		os=openedition
 		;;
@@ -1457,6 +1424,12 @@
 	os400*)
 		os=os400
 		;;
+	sunos5*)
+		os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
+		;;
+	sunos6*)
+		os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
+		;;
 	wince*)
 		os=wince
 		;;
@@ -1590,6 +1563,9 @@
 	c8051-*)
 		os=elf
 		;;
+	clipper-intergraph)
+		os=clix
+		;;
 	hexagon-*)
 		os=elf
 		;;
@@ -1735,6 +1711,9 @@
 	*-atari*)
 		os=mint
 		;;
+	*-wrs)
+		os=vxworks
+		;;
 	*)
 		os=none
 		;;
@@ -1780,6 +1759,9 @@
 			genix*)
 				vendor=ns
 				;;
+			clix*)
+				vendor=intergraph
+				;;
 			mvs* | opened*)
 				vendor=ibm
 				;;

Modified: branches/stable/source/src/build-aux/texinfo.tex
===================================================================
--- branches/stable/source/src/build-aux/texinfo.tex	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/build-aux/texinfo.tex	2018-07-10 17:26:48 UTC (rev 806)
@@ -3,7 +3,7 @@
 % Load plain if necessary, i.e., if running under initex.
 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
 %
-\def\texinfoversion{2018-03-10.14}
+\def\texinfoversion{2018-06-02.09}
 %
 % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
 % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
@@ -1528,6 +1528,9 @@
       \startlink attr{/Border [0 0 0]}%
         user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
     \endgroup}
+  % \pdfgettoks - Surround page numbers in #1 with @pdflink.  #1 may
+  % be a simple number, or a list of numbers in the case of an index
+  % entry.
   \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
   \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
   \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}

Modified: branches/stable/source/src/doc/build-tools.txt
===================================================================
--- branches/stable/source/src/doc/build-tools.txt	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/doc/build-tools.txt	2018-07-10 17:26:48 UTC (rev 806)
@@ -1,6 +1,6 @@
 autoconf (GNU Autoconf) 2.69
 automake (GNU automake) 1.16.1
-bison (GNU Bison) 3.0.4
+bison (GNU Bison) 3.0.5
 flex 2.6.0
 ltmain.sh (GNU libtool) 2.4.6
 m4 (GNU M4) 1.4.18

Modified: branches/stable/source/src/doc/tlbuild.info
===================================================================
--- branches/stable/source/src/doc/tlbuild.info	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/doc/tlbuild.info	2018-07-10 17:26:48 UTC (rev 806)
@@ -711,7 +711,7 @@
 
      autoconf (GNU Autoconf) 2.69
      automake (GNU automake) 1.16.1
-     bison (GNU Bison) 3.0.4
+     bison (GNU Bison) 3.0.5
      flex 2.6.0
      ltmain.sh (GNU libtool) 2.4.6
      m4 (GNU M4) 1.4.18

Modified: branches/stable/source/src/doc/tlbuild.texi
===================================================================
--- branches/stable/source/src/doc/tlbuild.texi	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/doc/tlbuild.texi	2018-07-10 17:26:48 UTC (rev 806)
@@ -474,7 +474,8 @@
 @end example
 
 Then you modify source files in @file{mydir/texk/dvipdfm-x} and rerun
- at code{make} in @file{mydir/Work/texk/dvipdfm-x} to rebuild.
+ at code{make} in @file{mydir/Work/texk/dvipdfm-x} to rebuild (that
+build directory is where the binaries end up).
 
 The second line of the @code{configure} invocation shows examples of
 extra things you likely want to specify if you intend to hack the
@@ -488,15 +489,15 @@
 
 @cindex size of source tree
 Finally, the above retrieves the entire TL source tree (several
-hundred megabytes).  It is natural to ask if this is really necessary.
+hundred megabytes). It is natural to ask if this is really necessary.
 Strictly speaking, the answer is no, but it is vastly more convenient
-to do so.  If you cut down the source tree, you must also give
+to do so. If you cut down the source tree, you must also give
 additional @code{configure} flags to individually disable using system
 versions of libraries, or the intricacies of the dependencies (such as
 @code{teckit} requiring @code{zlib}) will have undesired side effects.
 For an example, see the @code{build-pdftex.sh} script in the
- at code{pdftex} development source (@url{http://pdftex.org}), which is
-indeed a cut-down TL source tree.
+ at code{pdftex} development source (details at @url{http://pdftex.org}),
+which is indeed a cut-down TL source tree.
 
 @vindex --enable-missing @r{to ignore dependencies}
 Even with @code{--disable-all-pkgs}, dependencies will be checked.
@@ -675,7 +676,7 @@
 @pindex plain.tex at r{, not in source tree}
 The main consideration is that @code{make install} is not enough to
 make a usable @TeX{} installation.  Beyond the compiled binaries,
-(thousands of) support files are needed; just as a first example
+(thousands of) support files are needed; just as a first example,
 @file{plain.tex} is not in the source tree.
 
 These support files are maintained completely independently and are

Modified: branches/stable/source/src/libs/README
===================================================================
--- branches/stable/source/src/libs/README	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/README	2018-07-10 17:26:48 UTC (rev 806)
@@ -1,4 +1,4 @@
-$Id: README 47607 2018-05-04 03:48:43Z kakuto $
+$Id: README 48132 2018-07-04 07:14:37Z kakuto $
 Public domain.  Originally created by Karl Berry, 2005.
 
 Libraries we compile for TeX Live.
@@ -24,7 +24,7 @@
 graphite2 1.3.11 - checked 05mar18
   http://sourceforge.net/projects/silgraphite/files/graphite2/
 
-harfbuzz 1.7.6 - checked 07mar18
+harfbuzz 1.8.2 - checked 05jul18
   http://www.freedesktop.org/software/harfbuzz/release/
 
 icu 61.1 - checked 29mar18
@@ -49,7 +49,7 @@
 pixman 0.34.0 - checked 04feb16
   http://cairographics.org/releases/
 
-poppler 0.64.0 - checked 29apr18
+poppler 0.66.0 - checked 20jun18
   http://poppler.freedesktop.org/ - used by luatex and xetex
   (requires C++11)
 

Modified: branches/stable/source/src/libs/poppler/ChangeLog
===================================================================
--- branches/stable/source/src/libs/poppler/ChangeLog	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/ChangeLog	2018-07-10 17:26:48 UTC (rev 806)
@@ -1,3 +1,13 @@
+2018-06-20  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
+
+	Import poppler-0.66.0.
+	* version.ac: Adjust.
+
+2018-05-21  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
+
+	Import poppler-0.65.0.
+	* version.ac, Makefile.am: Adjust.
+
 2018-04-29  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
 
 	Import poppler-0.64.0.

Modified: branches/stable/source/src/libs/poppler/Makefile.am
===================================================================
--- branches/stable/source/src/libs/poppler/Makefile.am	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/Makefile.am	2018-07-10 17:26:48 UTC (rev 806)
@@ -1,4 +1,4 @@
-## $Id: Makefile.am 47014 2018-03-18 21:59:37Z kakuto $
+## $Id: Makefile.am 47788 2018-05-21 04:55:02Z kakuto $
 ## Proxy Makefile.am to build poppler for TeX Live.
 ##
 ##   Copyright 2016-2018 Karl Berry <tex-live at tug.org>
@@ -48,7 +48,6 @@
 	@POPPLER_TREE@/goo/grandom.cc \
 	@POPPLER_TREE@/goo/gstrtod.cc \
 	@POPPLER_TREE@/goo/FixedPoint.cc \
-	@POPPLER_TREE@/goo/GooHash.cc \
 	@POPPLER_TREE@/goo/GooList.cc \
 	@POPPLER_TREE@/goo/GooString.cc \
 	@POPPLER_TREE@/goo/GooTimer.cc

Modified: branches/stable/source/src/libs/poppler/Makefile.in
===================================================================
--- branches/stable/source/src/libs/poppler/Makefile.in	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/Makefile.in	2018-07-10 17:26:48 UTC (rev 806)
@@ -122,7 +122,6 @@
 	@POPPLER_TREE@/goo/grandom.$(OBJEXT) \
 	@POPPLER_TREE@/goo/gstrtod.$(OBJEXT) \
 	@POPPLER_TREE@/goo/FixedPoint.$(OBJEXT) \
-	@POPPLER_TREE@/goo/GooHash.$(OBJEXT) \
 	@POPPLER_TREE@/goo/GooList.$(OBJEXT) \
 	@POPPLER_TREE@/goo/GooString.$(OBJEXT) \
 	@POPPLER_TREE@/goo/GooTimer.$(OBJEXT)
@@ -220,7 +219,6 @@
 	@POPPLER_TREE@/fofi/$(DEPDIR)/FoFiType1.Po \
 	@POPPLER_TREE@/fofi/$(DEPDIR)/FoFiType1C.Po \
 	@POPPLER_TREE@/goo/$(DEPDIR)/FixedPoint.Po \
-	@POPPLER_TREE@/goo/$(DEPDIR)/GooHash.Po \
 	@POPPLER_TREE@/goo/$(DEPDIR)/GooList.Po \
 	@POPPLER_TREE@/goo/$(DEPDIR)/GooString.Po \
 	@POPPLER_TREE@/goo/$(DEPDIR)/GooTimer.Po \
@@ -540,7 +538,6 @@
 	@POPPLER_TREE@/goo/grandom.cc \
 	@POPPLER_TREE@/goo/gstrtod.cc \
 	@POPPLER_TREE@/goo/FixedPoint.cc \
-	@POPPLER_TREE@/goo/GooHash.cc \
 	@POPPLER_TREE@/goo/GooList.cc \
 	@POPPLER_TREE@/goo/GooString.cc \
 	@POPPLER_TREE@/goo/GooTimer.cc
@@ -718,9 +715,6 @@
 @POPPLER_TREE@/goo/FixedPoint.$(OBJEXT):  \
 	@POPPLER_TREE@/goo/$(am__dirstamp) \
 	@POPPLER_TREE@/goo/$(DEPDIR)/$(am__dirstamp)
- at POPPLER_TREE@/goo/GooHash.$(OBJEXT):  \
-	@POPPLER_TREE@/goo/$(am__dirstamp) \
-	@POPPLER_TREE@/goo/$(DEPDIR)/$(am__dirstamp)
 @POPPLER_TREE@/goo/GooList.$(OBJEXT):  \
 	@POPPLER_TREE@/goo/$(am__dirstamp) \
 	@POPPLER_TREE@/goo/$(DEPDIR)/$(am__dirstamp)
@@ -971,7 +965,6 @@
 @AMDEP_TRUE@@am__include@ @am__quote@@POPPLER_TREE@/fofi/$(DEPDIR)/FoFiType1.Po at am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote@@POPPLER_TREE@/fofi/$(DEPDIR)/FoFiType1C.Po at am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote@@POPPLER_TREE@/goo/$(DEPDIR)/FixedPoint.Po at am__quote@ # am--include-marker
- at AMDEP_TRUE@@am__include@ @am__quote@@POPPLER_TREE@/goo/$(DEPDIR)/GooHash.Po at am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote@@POPPLER_TREE@/goo/$(DEPDIR)/GooList.Po at am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote@@POPPLER_TREE@/goo/$(DEPDIR)/GooString.Po at am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote@@POPPLER_TREE@/goo/$(DEPDIR)/GooTimer.Po at am__quote@ # am--include-marker
@@ -1423,7 +1416,6 @@
 	-rm -f @POPPLER_TREE@/fofi/$(DEPDIR)/FoFiType1.Po
 	-rm -f @POPPLER_TREE@/fofi/$(DEPDIR)/FoFiType1C.Po
 	-rm -f @POPPLER_TREE@/goo/$(DEPDIR)/FixedPoint.Po
-	-rm -f @POPPLER_TREE@/goo/$(DEPDIR)/GooHash.Po
 	-rm -f @POPPLER_TREE@/goo/$(DEPDIR)/GooList.Po
 	-rm -f @POPPLER_TREE@/goo/$(DEPDIR)/GooString.Po
 	-rm -f @POPPLER_TREE@/goo/$(DEPDIR)/GooTimer.Po
@@ -1550,7 +1542,6 @@
 	-rm -f @POPPLER_TREE@/fofi/$(DEPDIR)/FoFiType1.Po
 	-rm -f @POPPLER_TREE@/fofi/$(DEPDIR)/FoFiType1C.Po
 	-rm -f @POPPLER_TREE@/goo/$(DEPDIR)/FixedPoint.Po
-	-rm -f @POPPLER_TREE@/goo/$(DEPDIR)/GooHash.Po
 	-rm -f @POPPLER_TREE@/goo/$(DEPDIR)/GooList.Po
 	-rm -f @POPPLER_TREE@/goo/$(DEPDIR)/GooString.Po
 	-rm -f @POPPLER_TREE@/goo/$(DEPDIR)/GooTimer.Po

Modified: branches/stable/source/src/libs/poppler/TLpatches/ChangeLog
===================================================================
--- branches/stable/source/src/libs/poppler/TLpatches/ChangeLog	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/TLpatches/ChangeLog	2018-07-10 17:26:48 UTC (rev 806)
@@ -1,3 +1,11 @@
+2018-06-20  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
+
+	* patch-03-time: Adapted.
+
+2018-05-21  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
+
+	* patch-03-time: Adapted.
+
 2018-04-29  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
 
 	* patch-03-time: Adapted.

Modified: branches/stable/source/src/libs/poppler/TLpatches/TL-Changes
===================================================================
--- branches/stable/source/src/libs/poppler/TLpatches/TL-Changes	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/TLpatches/TL-Changes	2018-07-10 17:26:48 UTC (rev 806)
@@ -1,4 +1,4 @@
-Changes applied to the poppler-0.64.0 tree as obtained from:
+Changes applied to the poppler-0.66.0 tree as obtained from:
 	http://poppler.freedesktop.org/
 
 Removed unused dirs:
@@ -11,7 +11,7 @@
 update version.ac
 mv poppler-src poppler-prev
 tar xf poppler-*.tar.gz
-mv poppler-0.64.0 poppler-src
+mv poppler-0.66.0 poppler-src
 cd poppler-src
 svn status >/tmp/s
 svn add # the ? lines

Modified: branches/stable/source/src/libs/poppler/TLpatches/patch-03-time
===================================================================
--- branches/stable/source/src/libs/poppler/TLpatches/patch-03-time	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/TLpatches/patch-03-time	2018-07-10 17:26:48 UTC (rev 806)
@@ -1,6 +1,6 @@
-diff -ur poppler-0.64.0/goo/gfile.h poppler-src/goo/gfile.h
---- poppler-0.64.0/goo/gfile.h	Wed Apr 18 03:04:26 2018
-+++ poppler-src/goo/gfile.h	Thu Apr 26 11:27:12 2018
+diff -ur poppler-0.66.0/goo/gfile.h poppler-src/goo/gfile.h
+--- poppler-0.66.0/goo/gfile.h	Wed Jun 20 06:16:47 2018
++++ poppler-src/goo/gfile.h	Wed Jun 20 14:32:44 2018
 @@ -51,8 +51,6 @@
  #    include <windows.h>
  #  endif
@@ -10,9 +10,9 @@
  #else
  #  include <unistd.h>
  #  include <sys/types.h>
-diff -ur poppler-0.64.0/poppler/Form.h poppler-src/poppler/Form.h
---- poppler-0.64.0/poppler/Form.h	Wed Apr 18 03:04:26 2018
-+++ poppler-src/poppler/Form.h	Wed Apr 25 18:40:18 2018
+diff -ur poppler-0.66.0/poppler/Form.h poppler-src/poppler/Form.h
+--- poppler-0.66.0/poppler/Form.h	Wed Jun 20 06:16:47 2018
++++ poppler-src/poppler/Form.h	Wed Jun 20 14:31:47 2018
 @@ -36,6 +36,7 @@
  
  #include <set>

Modified: branches/stable/source/src/libs/poppler/configure
===================================================================
--- branches/stable/source/src/libs/poppler/configure	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/configure	2018-07-10 17:26:48 UTC (rev 806)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for poppler (TeX Live) 0.64.0.
+# Generated by GNU Autoconf 2.69 for poppler (TeX Live) 0.66.0.
 #
 # Report bugs to <tex-k at tug.org>.
 #
@@ -580,8 +580,8 @@
 # Identity of this package.
 PACKAGE_NAME='poppler (TeX Live)'
 PACKAGE_TARNAME='poppler--tex-live-'
-PACKAGE_VERSION='0.64.0'
-PACKAGE_STRING='poppler (TeX Live) 0.64.0'
+PACKAGE_VERSION='0.66.0'
+PACKAGE_STRING='poppler (TeX Live) 0.66.0'
 PACKAGE_BUGREPORT='tex-k at tug.org'
 PACKAGE_URL=''
 
@@ -1307,7 +1307,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures poppler (TeX Live) 0.64.0 to adapt to many kinds of systems.
+\`configure' configures poppler (TeX Live) 0.66.0 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1374,7 +1374,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of poppler (TeX Live) 0.64.0:";;
+     short | recursive ) echo "Configuration of poppler (TeX Live) 0.66.0:";;
    esac
   cat <<\_ACEOF
 
@@ -1487,7 +1487,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-poppler (TeX Live) configure 0.64.0
+poppler (TeX Live) configure 0.66.0
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2134,7 +2134,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by poppler (TeX Live) $as_me 0.64.0, which was
+It was created by poppler (TeX Live) $as_me 0.66.0, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -4057,7 +4057,7 @@
 
 # Define the identity of the package.
  PACKAGE='poppler--tex-live-'
- VERSION='0.64.0'
+ VERSION='0.66.0'
 
 
 # Some tools Automake needs.
@@ -7647,7 +7647,7 @@
 
 
 cat >>confdefs.h <<_ACEOF
-#define POPPLER_VERSION "0.64.0"
+#define POPPLER_VERSION "0.66.0"
 _ACEOF
 
 
@@ -8341,7 +8341,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by poppler (TeX Live) $as_me 0.64.0, which was
+This file was extended by poppler (TeX Live) $as_me 0.66.0, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -8407,7 +8407,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-poppler (TeX Live) config.status 0.64.0
+poppler (TeX Live) config.status 0.66.0
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 

Modified: branches/stable/source/src/libs/poppler/poppler-src/CMakeLists.txt
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/CMakeLists.txt	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/CMakeLists.txt	2018-07-10 17:26:48 UTC (rev 806)
@@ -30,7 +30,7 @@
 endif()
 
 set(POPPLER_MAJOR_VERSION "0")
-set(POPPLER_MINOR_VERSION "64")
+set(POPPLER_MINOR_VERSION "66")
 set(POPPLER_MICRO_VERSION "0")
 set(POPPLER_VERSION "${POPPLER_MAJOR_VERSION}.${POPPLER_MINOR_VERSION}.${POPPLER_MICRO_VERSION}")
 
@@ -316,7 +316,6 @@
 set(poppler_SRCS
   goo/gfile.cc
   goo/gmempp.cc
-  goo/GooHash.cc
   goo/GooList.cc
   goo/GooTimer.cc
   goo/GooString.cc
@@ -491,7 +490,7 @@
 else()
 add_library(poppler ${poppler_SRCS})
 endif()
-set_target_properties(poppler PROPERTIES VERSION 75.0.0 SOVERSION 75)
+set_target_properties(poppler PROPERTIES VERSION 77.0.0 SOVERSION 77)
 if(MINGW)
     get_target_property(POPPLER_SOVERSION poppler SOVERSION)
     set_target_properties(poppler PROPERTIES SUFFIX "-${POPPLER_SOVERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}")
@@ -580,7 +579,6 @@
     ${CMAKE_CURRENT_BINARY_DIR}/poppler/poppler-config.h
     DESTINATION include/poppler)
   install(FILES
-    goo/GooHash.h
     goo/GooList.h
     goo/GooTimer.h
     goo/GooMutex.h

Modified: branches/stable/source/src/libs/poppler/poppler-src/ChangeLog
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/ChangeLog	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/ChangeLog	2018-07-10 17:26:48 UTC (rev 806)
@@ -1,3 +1,1294 @@
+commit 877dcec7e2357991d79508a2aefc39d1510bf235
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Tue Jun 19 23:16:47 2018 +0200
+
+    Poppler 0.66
+
+ CMakeLists.txt   | 4 ++--
+ NEWS             | 7 +++++++
+ cpp/Doxyfile     | 2 +-
+ qt5/src/Doxyfile | 2 +-
+ 4 files changed, 11 insertions(+), 4 deletions(-)
+
+commit 37d2aa88409429397a6c8801b34213f6eded8e1e
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Tue Jun 19 17:42:16 2018 +0200
+
+    PostScriptFunction::parseCode: Fix memory leak on malformed files
+
+    Fixes oss-fuzz/8859
+
+ poppler/Function.cc | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit e4f4cbddd11ae6386985879187007fa5add43624
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Tue Jun 12 09:32:57 2018 +0200
+
+    StreamPredictor: Move pixBytes calculation after checks
+
+    fixes oss-fuzz/8835
+
+ poppler/Stream.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit adb7cac1b787b35c4f5d25e0441e459ab92d0469
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Tue Jun 12 09:00:33 2018 +0200
+
+    GfxImageColorMap: Initialize y to prevent uninit mem use
+
+    Fixes oss-fuzz/8839
+
+ poppler/GfxState.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 6b37df791731e40837fa1eba86ae740650431438
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Wed Jun 6 17:56:27 2018 +0200
+
+    SampledFunction: Fix divide by zero
+
+    Actual valid values are 1, 2, 4, 8, 12, 16, 24, and 32 but this
+    check is easier
+
+    fixes oss-fuzz/8713
+
+ poppler/Function.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+commit d6a3dc3ebbc97fcdd3c45028b5741f4b99fc0279
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Wed Jun 6 17:46:17 2018 +0200
+
+    GfxAxialShading::parse: Fix memory leak on broken files
+
+    fixes oss-fuzz/8742
+
+ poppler/GfxState.cc | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+commit 599e28433268ceaa933cf2a2492c81da4418e207
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Tue Jun 5 20:11:19 2018 +0200
+
+    JBIG2Stream::readSymbolDictSeg: Fix potential uninitialized memory
+    read
+
+    fixes oss-fuzz/8748
+
+ poppler/JBIG2Stream.cc | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit a231de883b438af1807726fab4265ecf4689cf50
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Tue Jun 5 20:00:03 2018 +0200
+
+    CMap::parse2: Initialize end
+
+    fixes oss-fuzz/8747
+
+ poppler/CMap.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 2c629fefe2b2b1e2663521beeac432c808afe7c7
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Tue Jun 5 19:56:53 2018 +0200
+
+    JBIG2Stream::readSymbolDictSeg: Initialize dh
+
+    fixes oss-fuzz/8751
+
+ poppler/JBIG2Stream.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 0053966d3ec5b5c4eb6480417b2c8a8ccd910964
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Mon Jun 4 20:38:41 2018 +0200
+
+    JBIG2Stream::readSymbolDictSeg: Initialize refDX
+
+    fixes oss-fuzz/8696
+
+ poppler/JBIG2Stream.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 8dfe3fb37ec01e35eb22a0932fe708bc9b78cb4f
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Wed May 30 17:09:16 2018 +0200
+
+    LONG_LONG_MAX -> LLONG_MAX
+
+    that's the name the standard uses
+
+ poppler/Parser.cc | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit b4f0e2b27a0880801c7af0c82fe17894797511b2
+Author: Stefan Brüns <stefan.bruens at rwth-aachen.de>
+Date:   Sat May 26 19:51:20 2018 +0200
+
+    Splash: Reserve space for path segments upfront
+
+    Instead of iteratively growing the array reserve sufficient space
+    prior to populating the array.
+
+ poppler/SplashOutputDev.cc |  2 ++
+ splash/SplashPath.cc       | 18 ++++++++++++++++++
+ splash/SplashPath.h        |  4 ++++
+ 3 files changed, 24 insertions(+)
+
+commit 450a8a54e080b5bb80533b1777b3b670bea1f27a
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Wed May 30 09:09:12 2018 +0200
+
+    JBIG2Stream::readSymbolDictSeg: Initialize refDY
+
+    fixes oss-fuzz/8621
+
+ poppler/JBIG2Stream.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 1750c0155762e75d0a80ab55b50d1bfd172c2430
+Author: Stefan Brüns <stefan.bruens at rwth-aachen.de>
+Date:   Tue May 29 23:49:05 2018 +0200
+
+    splash: Correctly manipulate spot colors if SPOT_NCOMPS != 4
+
+    The default number of spot colors is 4, in this case the change is
+    without effect, otherwise only the last 4 colors where handled.
+
+ splash/SplashTypes.h | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+commit fb4629eb4b1787332b88b330da16353e5ade7b4d
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Tue May 29 20:32:23 2018 +0200
+
+    SplashFTFont: Early return if face->units_per_EM is 0
+
+    fixes oss-fuzz/8617
+
+ splash/SplashFTFont.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 943a465d7b76b26de83d2038226c72bcf619c29f
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Tue May 29 20:23:51 2018 +0200
+
+    SplashFTFont: Initialize textScale
+
+    fixes oss-fuzz/8616
+
+ splash/SplashFTFont.cc | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit f821faa1795c1b25104d84e9f5a7e8ad218baa61
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Tue May 29 20:18:26 2018 +0200
+
+    CMap::parse2: Initialize start
+
+    fixes oss-fuzz/8611
+
+ poppler/CMap.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit a76c8fbd50a3a5cbe0487158e9d2b325e596d2c6
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Tue May 29 01:01:26 2018 +0200
+
+    GfxSeparationColorSpace::getRGB: ensure color2 doesn't have uninit
+    values
+
+    if alt->getNComps() is bigger than func->getOutputSize() (which
+    is most
+    likely a faulty file) we init those indexes of color2 with 0
+
+    fixes oss-fuzz/8586
+
+ poppler/GfxState.cc | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+commit e35fdb1448b7860d697b9c2ec8bda49c7a8a3ae5
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Tue May 29 00:59:22 2018 +0200
+
+    JBIG2Stream::readTextRegion: Initialize ds
+
+    fixes oss-fuzz/8594
+
+ poppler/JBIG2Stream.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit bb25c0d46f1f0e037805f0c6dde07f3ea9c9320c
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Tue May 29 00:55:28 2018 +0200
+
+    Gfx::doRadialShFill: Initialize colorA, colorB and colorC
+
+    fixes oss-fuzz/8587
+
+ poppler/Gfx.cc | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+commit b8cf8b04cbd1c0c5643cc77ed7b0b60525ecf080
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Mon May 28 23:51:32 2018 +0200
+
+    FoFiType1::parse: Don't copy to buf more than the available file
+
+    fixes oss-fuzz/8576
+
+ fofi/FoFiType1.cc | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+commit 10a3dc2a9c92349e498ea36bb342b821dcfc9d76
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Mon May 28 17:44:34 2018 +0200
+
+    GfxState.cc: Fix undefined behaviour when compBits is 31
+
+    it's a technical issue since according to spec biggest
+    valid value for compBits is 16, but this is simpler imho
+
+    fixes oss-fuzz/8582
+
+ poppler/GfxState.cc | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit 96e7bc19ffcaf46d4cb69660ed040c09d46815d6
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Sun May 27 09:42:24 2018 +0200
+
+    JBIG2Stream::readTextRegion: Initialize a few variables
+
+    So if the stream is broken we don't use uninitialized variables
+
+    fixes oss-fuzz/8547
+
+ poppler/JBIG2Stream.cc | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit 9c0c538e8d1aa39cd136cfb8fe0fbfe1def5174d
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Sun May 27 09:34:16 2018 +0200
+
+    Gfx::doAxialShFill: initialize color1
+
+    fixes oss-fuzz/8546
+
+ poppler/Gfx.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 18f376c0dff184851b3ee4c05c40b4ee2c21da8c
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Sun May 27 09:29:49 2018 +0200
+
+    FoFiType1::parse: Fix reading past font length
+
+    fixes oss-fuzz/8545
+
+ fofi/FoFiType1.cc | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+commit 19d3993f3f40b5113141d5a55acea307c174f1d3
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Sun May 27 09:10:05 2018 +0200
+
+    XRef::fetch: Don't try to fetch objects with negative offset
+
+    fixes oss-fuzz/8433
+
+ poppler/XRef.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 9a8d33246601dbd2bea98bb3404596848f71162a
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Sun May 27 08:47:19 2018 +0200
+
+    Splash::fillGlyph2: fix buffer overflow
+
+    Make sure xx / 8 + 1 is not out of bounds
+
+    fixes oss-fuzz/8422
+
+ splash/Splash.cc | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit 1bc71245fa88dc23dc355f926f50f04896739fff
+Author: Adam Reichold <adam.reichold at t-online.de>
+Date:   Sat May 26 11:54:41 2018 +0200
+
+    LZWStream: make inputBuf unsigned
+
+    since shifting negative numbers is undefined according to spec
+
+ poppler/Stream.cc | 6 +++---
+ poppler/Stream.h  | 4 ++--
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+commit 68c5977980a60b2fbac0a5938e697cf09f37b0a2
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Fri May 25 23:06:53 2018 +0200
+
+    BaseCryptStream: Initialize all of objKey
+
+    fixes oss-fuzz/8493
+
+ poppler/Decrypt.cc | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+commit 14adecb9693345b7e3baa6dee05f5c88dde7952c
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Fri May 25 22:57:29 2018 +0200
+
+    Decrypt::md5: initialize x
+
+    When msgLen is small enough x would had initialized values for some
+    parts of the md5 calculation
+
+    fixes oss-fuzz/8492
+
+ poppler/Decrypt.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 71bb82bdecccc235e15255635cab2c31cce58e0e
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Fri May 25 22:52:31 2018 +0200
+
+    Gfx::doAxialShFill: initialize color0
+
+    fixes oss-fuzz/8470
+
+ poppler/Gfx.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit b245154fdebc9a78db163bc95959c6c8f5b4126f
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Fri May 25 22:46:22 2018 +0200
+
+    Parser::makeStream: Don't overflow length
+
+    fixes oss-fuzz/8499
+
+ poppler/Parser.cc | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+commit 86777478387577aee8242eb2f11932041e87eff5
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Fri May 25 19:44:50 2018 +0200
+
+    Splash::fillWithPattern: initialize pipe
+
+    Makes sure if things fail we're not painting with uninitialized memory
+
+    fixes oss-fuzz/8538
+
+ splash/Splash.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 97caec070090d112d4fb5b63dc433a34e214c7e5
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Fri May 25 19:38:19 2018 +0200
+
+    FoFiType1C::readTopDict: Return early if parsing fails
+
+    fixes oss-fuzz/8456
+
+ fofi/FoFiType1C.cc | 3 +++
+ 1 file changed, 3 insertions(+)
+
+commit 7e2189377bfaa0594e25eaba26aca47bea59f315
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Fri May 25 17:47:07 2018 +0200
+
+    GfxGouraudTriangleShading::parse: Add bounds check for compBits
+
+    The spec is much more strict on what is valid, but i'm only doing
+    a check so that the code doesn't break
+
+ poppler/GfxState.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+commit fef32ba463a225618a967c541d939fd69e02f2dd
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Fri May 25 17:42:22 2018 +0200
+
+    GfxPatchMeshShading::parse: Add bounds check for compBits
+
+    The spec is much more strict on what is valid, but i'm only doing
+    a check so that the code doesn't break
+
+    fixes oss-fuzz/8445
+
+ poppler/GfxState.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+commit 3b9d8025dbdfcfac94ede20b05d86d177393cde7
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Fri May 25 17:26:37 2018 +0200
+
+    Splash: Fix another potential uninitialized memory use
+
+    fixes oss-fuzz/8466
+
+ splash/Splash.cc | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+commit 0e3b18a48c3907a49c51a0ceded6078a2fd790eb
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Fri May 25 17:06:13 2018 +0200
+
+    SplashUnivariatePattern::getColor: Fix potential uninitialized
+    memory read
+
+    If the GfxUnivariateShading doesn't provide enough bits of color
+    fill them with 0 as to not have random memory read
+
+    fixes oss-fuzz/8470
+
+ poppler/GfxState.cc        | 5 +++--
+ poppler/GfxState.h         | 4 +++-
+ poppler/SplashOutputDev.cc | 6 +++++-
+ 3 files changed, 11 insertions(+), 4 deletions(-)
+
+commit c75500bf6b2af4b9a26467ce55d1f2879e916b79
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Fri May 25 16:41:36 2018 +0200
+
+    T3FontCache: change the order in which the overflow checks are done
+
+    fixes oss-fuzz/8479
+
+ poppler/SplashOutputDev.cc | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+commit 4ea7ac960d9ecb6a407d0e660312f5701d3dcd49
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Fri May 25 16:35:49 2018 +0200
+
+    SplashFTFont::getGlyphPath: early return if textScale == 0
+
+    fixes oss-fuzz/8529
+
+ splash/SplashFTFont.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+commit c1164653bd8d6bcb7da1d959634f63592a393235
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Fri May 25 16:26:44 2018 +0200
+
+    GfxGouraudTriangleShading::parse: Protect against coordBits <= 0
+
+    fixes oss-fuzz/8524
+
+ poppler/GfxState.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+commit a7154bcc6aba5429dc6cc024bd90dae2f1d2d0c1
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Fri May 25 16:21:45 2018 +0200
+
+    XRef::readXRefTable: Rewrite overflow check
+
+    In a way that it doesn't depend on undefined behaviour
+
+    fixes oss-fuzz/8528
+
+ poppler/XRef.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit f966b9096d046aaee4891de11f74207218cc929b
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Thu May 24 23:58:41 2018 +0200
+
+    SplashOutputDev::drawSoftMaskedImage: Fix uninitialized memory read
+
+    It can happen that maskStr->doGetChars doesn't give us the number
+    of chars we wanted, if that happens just set the remainder to zero
+
+ poppler/SplashOutputDev.cc | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+commit b228892adb01f978d5e6045e1e61741bca1950d2
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Thu May 24 23:49:12 2018 +0200
+
+    Splash::blitImageClipped: initialize pixel
+
+    At least this way if the getPixels call we're not drawing random
+    memory
+    and thus we get a stable render which helps with regtests
+
+ splash/Splash.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 67be3708cc4dea9e03f5d0ce5b0214fff35748f2
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Thu May 24 23:29:55 2018 +0200
+
+    SplashFTFont::makeGlyph: Fix use of uninitialized data
+
+    caused by the bugfix to not divide by zero
+
+ splash/SplashFTFont.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+commit c758fc980834882528eeae82568494e46d189cc5
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Thu May 24 23:19:16 2018 +0200
+
+    FoFiType1::parse: Fix invalid memory access
+
+    Make sure there's enough line left before calling strncmp
+
+    fixes oss-fuzz/8425
+
+ fofi/FoFiType1.cc | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+commit 07318f3899248f67a58148b29a9555ff47a1b083
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Thu May 24 20:15:42 2018 +0200
+
+    StreamReader::cmp: Fix potential undefined behaviour
+
+    going outside an array range is technically undefined behaviour,
+    even if then after you go back in range with the next operation, so
+    we first calculate the diff and then add it to the array
+
+ fofi/FoFiIdentifier.cc | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+commit 6b91d37a704fb2b6fa9529d859c366c331327ab9
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Thu May 24 18:22:00 2018 +0200
+
+    SplashOutputDev: Fix memory leak on malformed files
+
+    i.e. SplashOutputDev::endTextObject is not called after
+    SplashOutputDev::drawChar
+
+    fixes oss-fuzz/8508
+
+ poppler/SplashOutputDev.cc | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit c9650369c5dd74812db515d986ded898b9002ae4
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Thu May 24 18:20:12 2018 +0200
+
+    Splash::scaleMaskYuXu: Free internal bitmap data on error
+
+    this way we don't try to use it later, which will be an uninitialized
+    memory read
+
+    fixes oss-fuzz/8511
+
+ splash/Splash.cc | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit f279778fe0aca610cdecb70d0a714bbaa08b0d22
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Thu May 24 13:06:00 2018 +0200
+
+    JBIG2Stream::readSymbolDictSeg: Fix potential uninitialized memory use
+
+    fixes oss-fuzz/8468
+
+ poppler/JBIG2Stream.cc | 2 ++
+ 1 file changed, 2 insertions(+)
+
+commit ea72a3f3dc1619482ab2502dc50fe628600f38b5
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Thu May 24 12:42:54 2018 +0200
+
+    gmallocn: move the operation after the checks
+
+    fixes oss-fuzz/8423
+
+ goo/gmem.cc | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+commit aa39d079dc3b68b0a3512408706d053d664d557d
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Thu May 24 12:40:38 2018 +0200
+
+    XRef::readXRefStreamSection: Add integer overflow check
+
+    fixes oss-fuzz/8444
+
+ poppler/XRef.cc | 3 +++
+ 1 file changed, 3 insertions(+)
+
+commit db73587c566f8e50f03b24628e8948a558ee7039
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Thu May 24 11:56:39 2018 +0200
+
+    StreamPredictor: move rowBytes calculation after overflow check
+
+    fixes oss-fuzz/8498
+
+ poppler/Stream.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 76820f5ab932a9ed18913bc7d1a452ddf060c133
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Thu May 24 01:12:07 2018 +0200
+
+    JBIG2Stream::readPageInfoSeg: Fix memory leak on malformed documents
+
+    fixes oss-fuzz/8463
+
+ poppler/JBIG2Stream.cc | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit ffb0daefda688564c1456f4b8b3f5a715d228cdc
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Wed May 23 19:06:51 2018 +0200
+
+    Apply previous optimization also to Splash::pipeRunAARGB8
+
+ splash/Splash.cc | 28 +++++++++++++++++++---------
+ 1 file changed, 19 insertions(+), 9 deletions(-)
+
+commit f47936af75088c55a19fe6b1a67128fcc3f57b08
+Author: Stefan Brüns <stefan.bruens at rwth-aachen.de>
+Date:   Wed May 23 19:05:50 2018 +0200
+
+    Small optimization for AAXRGB8 pipes
+
+    Skip some computations if both src and dest alpha are zero, or if
+    src is fully opaque. For common cases (majority of pixels fully
+    opaque) like in fdo#81211, this reduces execution time of
+    pipeRunAAXBGR8 by 50% (-20% total execution time).
+
+ splash/Splash.cc | 29 ++++++++++++++++++++---------
+ 1 file changed, 20 insertions(+), 9 deletions(-)
+
+commit 60ec88b3ca5f109b3532dbf2f36df66aed2d7bbf
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Wed May 23 19:49:29 2018 +0200
+
+    greallocn: move the operation to after the checks
+
+    fixes oss-fuzz/8484
+
+ goo/gmem.cc | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+commit e0fb18040378659c98fedb4bdaff6a903ddd095b
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Wed May 23 19:40:50 2018 +0200
+
+    Gfx::opSetExtGState: Fix memory leak on broken files
+
+    doSoftMask was called just once, from opSetExtGState, but was
+    given the duty to delete blendingColorSpace that given doSoftMask
+    has various early returns is hard to do right, so i've moved
+    the deletion to opSetExtGState itself
+
+    fixes oss-fuzz/8431
+
+ poppler/Gfx.cc | 8 ++------
+ 1 file changed, 2 insertions(+), 6 deletions(-)
+
+commit 86991adb172fd55decdc72ec6fc34d41b19beafa
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Wed May 23 19:35:27 2018 +0200
+
+    Gfx::doRadialShFill: Fix potential divide by zero
+
+    fixes oss-fuzz/8476
+
+ poppler/Gfx.cc | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+commit 62c7a6a135aa8c70f638bac9b41a11c4e69c8452
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Wed May 23 19:29:39 2018 +0200
+
+    GfxImageColorMap::GfxImageColorMap: Bail out early if bits <= 0
+
+    fixes oss-fuzz/8478
+
+ poppler/GfxState.cc | 3 +++
+ 1 file changed, 3 insertions(+)
+
+commit 6e2de368f620d2e459a4cfe6533a8c29fae6d8c9
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Wed May 23 19:21:30 2018 +0200
+
+    SplashFTFont::SplashFTFont: Early return if textScale is 0
+
+    fixes oss-fuzz/8482
+
+ splash/SplashFTFont.cc | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+commit 8d715bfc7c3610b823721dc26368728795baa2fe
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Wed May 23 15:44:05 2018 +0200
+
+    GfxPatchMeshShading::parse: Error out if BitsPerCoordinate <= 0
+
+ poppler/GfxState.cc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+commit f5fb32bd4b64040dc0f9b9e1555dabce804ba566
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Wed May 23 15:38:26 2018 +0200
+
+    Splash::scaleMaskYuXu: Also check for srcHeight <= 0
+
+ splash/Splash.cc | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit 0318e1667c7b137493f22be61b835eb914f68fa9
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Wed May 23 15:34:32 2018 +0200
+
+    GfxPatchMeshShading::parse: Fix memory leak on malformed documents
+
+    fixes oss-fuzz/8487
+
+ poppler/GfxState.cc | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+commit 3ca2d43b7ddcca08bc026c6564f89ffbe0dde506
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Wed May 23 00:27:08 2018 +0200
+
+    warning--
+
+ poppler/Decrypt.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 58e056c4b15f262b7715f8061d6885eb80044d0d
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Wed May 23 00:23:19 2018 +0200
+
+    Revert 31c3832b996acbf04ea833e304d7d21ac4533a57
+
+    So shifting left negative values is undefined behaviour according
+    to the
+    spec but if we don't do it we break, so we seem to be depending
+    on this
+    undefined behaviour, will try to figure out a better fix
+
+ poppler/Stream.cc | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+commit a6c2eb671f08beb682e086d5f6791fdb78906a7c
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Tue May 22 22:12:03 2018 +0200
+
+    Make sure dash[i] is intialized
+
+    even if obj is not a number
+
+    fixes oss-fuzz/8462
+
+ poppler/Gfx.cc | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+commit 083bfa59378be1c008cb6543f7e9bebde29a4079
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Tue May 22 22:01:35 2018 +0200
+
+    nBitsDiffObjects can only be 32 as per spec
+
+    fixes oss-fuzz/8464
+
+ poppler/Hints.cc | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+commit 942a426f2844b66758b6b443234c3686d61420cc
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Tue May 22 21:41:51 2018 +0200
+
+    Parser::makeStream: Make sure length is not negative
+
+    fixes oss-fuzz/8469
+
+ poppler/Parser.cc | 3 +++
+ 1 file changed, 3 insertions(+)
+
+commit bf03344ad26b1227b5052420feabe062441c02ed
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Tue May 22 20:36:05 2018 +0200
+
+    StandardSecurityHandler::isUnencrypted: Fix uninitialized memory use
+
+    fixes oss-fuzz/8426
+
+ poppler/SecurityHandler.cc | 3 +++
+ 1 file changed, 3 insertions(+)
+
+commit 31c3832b996acbf04ea833e304d7d21ac4533a57
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Tue May 22 20:25:18 2018 +0200
+
+    LZWStream::getCode: Don't left shift negative values
+
+    it's undefined behaviour
+
+ poppler/Stream.cc | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+commit 2c0a0b07fdb2c76487ca4af7b2f50da9904c6c23
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Tue May 22 20:15:39 2018 +0200
+
+    Gfx::doImage: Fix memory leak on malformed documents
+
+    fixes oss-fuzz/8452
+
+ poppler/Gfx.cc | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit ace7ca3e0dd1570ef6804c0f054742b2996b9b9f
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Tue May 22 20:10:01 2018 +0200
+
+    SplashAxialPattern: fix potential divide by zero
+
+ poppler/SplashOutputDev.cc | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+commit 3b8634e744aa5ba3b317fd3378ba07a438826827
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Tue May 22 20:07:50 2018 +0200
+
+    GfxAxialShading::getParameterRange: Fix potential divide by zero
+
+    fixes oss-fuzz/8436
+
+ poppler/GfxState.cc | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+commit 91079d4f482b35f190a4f2bbd9f4fb6a8ad7c2a2
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Tue May 22 20:01:56 2018 +0200
+
+    SampledFunction: Fix potential divide by zero
+
+    fixes oss-fuzz/8455
+
+ poppler/Function.cc | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+commit 6169bfb1ecd289a8235be0b8884a550f5d1ad926
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Tue May 22 19:56:34 2018 +0200
+
+    GfxState.cc: Fix potential division by zero
+
+    fixes oss-fuzz/8465
+
+ poppler/GfxState.cc | 20 ++++++++++++++++----
+ 1 file changed, 16 insertions(+), 4 deletions(-)
+
+commit 0868c499a9f5f37f8df5c9fef03c37496b40fc8a
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Tue May 22 19:42:38 2018 +0200
+
+    Parser::makeStream: Fix potential integer overflow
+
+ poppler/Parser.cc | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+commit dbe330678766d1260d7f595d238e90aeae1194d6
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Tue May 22 19:31:34 2018 +0200
+
+    XRef::constructXRef: Prevent overflow when calculating newSize
+
+    fixes oss-fuzz/8421
+
+ poppler/XRef.cc | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+commit 224dda4d292a097866f109a9d2cec4b3ba78eb97
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Tue May 22 19:17:20 2018 +0200
+
+    Fix out of bounds write in BaseCryptStream
+
+    fixes oss-fuzz/8420
+
+ poppler/Decrypt.cc | 14 ++++++++------
+ 1 file changed, 8 insertions(+), 6 deletions(-)
+
+commit 0c0c368fed70c1db64ce04b135fd5b060a1f0653
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Tue May 22 18:26:29 2018 +0200
+
+    LZWStream::clearTable: init newChar to 0
+
+    it should not be needed because on well formed streams it will be
+    properly initialized in processNextCode but
+    this solves an uninitialized memory use on malformed documents
+
+    fixes oss-fuzz/8457
+
+ poppler/Stream.cc | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit e7f59e39a0aca2a8a363fc0edcf25fb5aaada7a5
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Tue May 22 18:22:29 2018 +0200
+
+    Splash::scaleMaskYuXu: Fix crash on malformed files
+
+    fixes oss-fuzz/8435
+    fixes oss-fuzz/8441
+
+ splash/Splash.cc | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+commit 547f19cd420f2d579d921620545e6496adb6a9fb
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Tue May 22 18:17:58 2018 +0200
+
+    Fix crash in "generic" GlobalParams::findSystemFontFile
+
+    Not very important since we usually either use the fontconfig or
+    the windows one
+
+    fixes oss-fuzz/8427
+
+ poppler/GlobalParams.cc | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+commit d1d8dea64db53fb151fede27efd5fd3308820a51
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Tue May 22 18:13:19 2018 +0200
+
+    Fix memory leak on malformed files
+
+    fixes oss-fuzz/8430
+
+ poppler/Gfx.cc | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+commit 127d0fe3a209b04fc9efb086d423bca4ba359dca
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Tue May 22 01:08:12 2018 +0200
+
+    Fix overflownLongLong check
+
+    We actually want integer math here since doubles lose the precision we
+    want at that high long long values
+
+ poppler/Lexer.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit c9e2dc7ea7e098875e6b93566bdb1d14451c3673
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Sat May 19 17:05:25 2018 +0200
+
+    Poppler 0.65.0
+
+ CMakeLists.txt         |  4 ++--
+ NEWS                   | 22 ++++++++++++++++++++++
+ cpp/CMakeLists.txt     |  2 +-
+ cpp/Doxyfile           |  2 +-
+ qt5/src/CMakeLists.txt |  2 +-
+ qt5/src/Doxyfile       |  2 +-
+ 6 files changed, 28 insertions(+), 6 deletions(-)
+
+commit 921de21733816fc6cd66c70c7a4914fbfee924d6
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Fri May 18 00:45:59 2018 +0200
+
+    qt5: remove duplicate code
+
+    Create new toPopplerAdditionalActionType private function
+
+ qt5/src/poppler-annotation.cc | 15 +--------------
+ qt5/src/poppler-form.cc       | 17 ++---------------
+ qt5/src/poppler-private.cc    | 18 ++++++++++++++++++
+ qt5/src/poppler-private.h     |  2 ++
+ 4 files changed, 23 insertions(+), 29 deletions(-)
+
+commit 083139775fd4ee8dd073347bb0e2835aab334444
+Author: Andre Heinecke <aheinecke at intevation.de>
+Date:   Wed May 2 16:20:40 2018 +0200
+
+    qt5: Add widget annot actions to FormFields
+
+    This adds API to access AnnotWidget actions which
+    are associated with a FormField.
+
+ qt5/src/poppler-form.cc | 31 +++++++++++++++++++++++++++++++
+ qt5/src/poppler-form.h  |  8 ++++++++
+ 2 files changed, 39 insertions(+)
+
+commit 784bf432bffadf654b213caa21ec95fafb963299
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Tue May 8 01:16:06 2018 +0200
+
+    Fix build with -DFONT_CONFIGURATION=generic
+
+ poppler/GlobalParams.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 07b8f838b3d8859a3ad34a3140bb24475bd6ac2c
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Mon May 7 19:13:07 2018 +0200
+
+    cast to void * to bypass new gcc -Wclass-memaccess warning
+
+    Yes what we're doing there is a bit nasty but it works :D
+
+ poppler/Array.cc | 2 +-
+ poppler/Dict.cc  | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+commit 2e750862ed5cba42fba2c6dd953820445d9c64cb
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Mon May 7 19:02:40 2018 +0200
+
+    Remove useless memset
+
+    Parent already has a proper constructor that initializes stuff and on
+    top of that the sizeof was of the pointer and not of the class itself
+
+ poppler/StructTreeRoot.cc | 1 -
+ 1 file changed, 1 deletion(-)
+
+commit 030c6123c42813818fbb94717d301d4723671545
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Sun May 6 17:25:39 2018 +0200
+
+    Fix windows build
+
+ poppler/GlobalParamsWin.cc | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+commit 62ed50c649670423136a49ae0fc39a6d314336a7
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Sun May 6 17:01:30 2018 +0200
+
+    Remove GlobalParams::getUnicodeToUnicode
+
+    As shown by Adam in f559cc94310c149a61eb246e1aff7c093f3406b5 it was a
+    noop since we were not filling the hash it tried to get info from
+
+ poppler/GfxFont.cc     | 45 +--------------------------------------------
+ poppler/GlobalParams.h |  1 -
+ 2 files changed, 1 insertion(+), 45 deletions(-)
+
+commit 18cc4c3006695bbebd1d99d953d555a0bb3a3a65
+Author: Adam Reichold <adam.reichold at t-online.de>
+Date:   Wed Feb 21 20:15:22 2018 +0100
+
+    Make UnicodeMap a move-only type to simplify the initialization of
+    residentUnicodeMaps s.t. it is closer to the GooHash-based version.
+
+ poppler/GlobalParams.cc |  35 ++++++----------
+ poppler/UnicodeMap.cc   | 106
+ +++++++++++++++++++++++++++++++++++-------------
+ poppler/UnicodeMap.h    |  16 ++++----
+ 3 files changed, 97 insertions(+), 60 deletions(-)
+
+commit 75cba9a1434c991534795d9185d7b755d9ed288c
+Author: Adam Reichold <adam.reichold at t-online.de>
+Date:   Sun Feb 18 16:12:19 2018 +0100
+
+    Remove GooHash after replacing it by std::unordered_map.
+
+ CMakeLists.txt |   2 -
+ goo/GooHash.cc | 403
+ ---------------------------------------------------------
+ goo/GooHash.h  |  93 -------------
+ 3 files changed, 498 deletions(-)
+
+commit ccf5fbf898a27b02085b7b0707e5f59bee443fb3
+Author: Adam Reichold <adam.reichold at t-online.de>
+Date:   Sun Feb 18 16:23:36 2018 +0100
+
+    Also replace the Win32-specific usage of GooHash by std::unordered_map
+    on a best-effort basis.
+
+ poppler/GlobalParams.cc    |  6 ------
+ poppler/GlobalParams.h     |  3 ++-
+ poppler/GlobalParamsWin.cc | 25 ++++++++++++-------------
+ 3 files changed, 14 insertions(+), 20 deletions(-)
+
+commit 85e43288159804c57b3168fa95f955c41040bd29
+Author: Adam Reichold <adam.reichold at t-online.de>
+Date:   Sun Feb 18 16:11:55 2018 +0100
+
+    Replace GooHash by std::unordered_map in PSOutputDev.
+
+ poppler/PSOutputDev.cc | 31 +++++++++++--------------------
+ poppler/PSOutputDev.h  |  8 +++++---
+ 2 files changed, 16 insertions(+), 23 deletions(-)
+
+commit d5701be9c7daaf097698c0db57e004c4782450ee
+Author: Adam Reichold <adam.reichold at t-online.de>
+Date:   Sun Feb 18 16:11:29 2018 +0100
+
+    Replace GooHash by std::unordered_map in OutputDev.
+
+ poppler/Gfx.cc         | 20 ++++----------------
+ poppler/OutputDev.cc   | 15 ++++-----------
+ poppler/OutputDev.h    | 15 +++++++++------
+ poppler/PSOutputDev.h  |  3 ++-
+ poppler/ProfileData.cc | 10 +---------
+ poppler/ProfileData.h  | 25 ++++++++++---------------
+ test/pdf-inspector.cc  | 17 +++++------------
+ 7 files changed, 35 insertions(+), 70 deletions(-)
+
+commit f559cc94310c149a61eb246e1aff7c093f3406b5
+Author: Adam Reichold <adam.reichold at t-online.de>
+Date:   Sun Feb 18 16:10:59 2018 +0100
+
+    Replace GooHash by std::unordered_map in GlobalParams.
+
+ poppler/CharCodeToUnicode.cc |   9 +-
+ poppler/CharCodeToUnicode.h  |   3 +-
+ poppler/GlobalParams.cc      | 218
+ ++++++++++++++-----------------------------
+ poppler/GlobalParams.h       |  34 +++----
+ 4 files changed, 97 insertions(+), 167 deletions(-)
+
+commit 41ad41d6eb726aabd3bff18db5c08422e0d18807
+Author: Adam Reichold <adam.reichold at t-online.de>
+Date:   Sun Feb 18 16:10:16 2018 +0100
+
+    Replace GooHash by std::unordered_map in FoFiTrueType.
+
+ fofi/FoFiTrueType.cc | 39 +++++++++++++++------------------------
+ fofi/FoFiTrueType.h  |  8 +++++---
+ 2 files changed, 20 insertions(+), 27 deletions(-)
+
+commit 55272138c3835dd9db8733850304ffe966e6478d
+Author: Adam Reichold <adam.reichold at t-online.de>
+Date:   Tue Feb 20 09:07:17 2018 +0100
+
+    Add conversion methods between GooString and std::string.
+
+ goo/GooString.h | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+commit 08a4ac65d202742209bca6cf3806c4d111a5522c
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Fri May 4 15:51:18 2018 +0200
+
+    FindLIBOPENJPEG2.cmake: Remove cache code
+
+    It wasn't working since the if mentioned LIBOPENJPEG2_INCLUDE_DIR
+    instead of LIBOPENJPEG2_INCLUDE_DIRS
+    and when fixing the typo it broke the build because we were not
+    defining USE_OPENJPEG2, so better just
+    remove the broken if code
+
+ cmake/modules/FindLIBOPENJPEG2.cmake | 22 +++++++---------------
+ 1 file changed, 7 insertions(+), 15 deletions(-)
+
+commit 8f94bc8e6f65420a63411ead3a7e838a9542acbd
+Author: Bjarni Ingi Gislason <bjarniig at rhi.hi.is>
+Date:   Fri May 4 15:29:09 2018 +0200
+
+    pdffonts: Minor formatting changes in the man page
+
+    Bug #105194
+
+ utils/pdffonts.1 | 18 ++++++++++--------
+ 1 file changed, 10 insertions(+), 8 deletions(-)
+
+commit 7bd0f774508f543616ebb2ad1f4558fdacfca5b7
+Author: Zsombor Hollay-Horvath <hollay.horvath at gmail.com>
+Date:   Fri May 4 15:23:21 2018 +0200
+
+    cpp: Expose more image modes, add option to select mode in renderer
+
+    Bug #105558
+
+ cpp/poppler-image.cpp         |  46 +++++++++++++++-
+ cpp/poppler-image.h           |   5 +-
+ cpp/poppler-page-renderer.cpp | 124
+ +++++++++++++++++++++++++++++++++++++++++-
+ cpp/poppler-page-renderer.h   |  13 +++++
+ 4 files changed, 184 insertions(+), 4 deletions(-)
+
+commit 60b4fe65bc9dc9b82bbadf0be2e3781be796a13d
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Tue May 1 02:46:17 2018 +0200
+
+    FoFiType1C::cvtGlyph: Fix infinite recursion on malformed documents
+
+    Bugs #104942, #103238
+
+ fofi/FoFiType1C.cc | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+commit 8429a67536b7c2f6d752e4a522ee98e6f76a40f9
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Tue May 1 02:44:37 2018 +0200
+
+    XRef: Fix runtime undefined behaviour
+
+    Going to the position -1 of an array is undefined behaviour, so
+    don't do
+    it
+
+    Bug #105970
+
+ poppler/XRef.cc | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+commit 9d42769705180d6df4ba8415849ef8790a0e9b1d
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Tue May 1 02:43:21 2018 +0200
+
+    Add the invisible character check to SplashOutputDev::beginType3Char
+
+    Bug #106244
+
+ poppler/SplashOutputDev.cc | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+commit 15d6519933256ffd1746eb6c7988def34228952e
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Mon Apr 30 15:09:26 2018 +0200
+
+    cpp: add a newline after the error line
+
+ cpp/poppler-private.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 6085b7b35b8ee6b0aab2d1b55064f79cb7e2c2fb
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Fri Mar 23 16:46:09 2018 +0100
+
+    Make poppler_form_field_get_font_size return 0
+
+    It was doing that anyway but in a more complex way.
+
+    Added a note into the docu so that people can volunteer to come
+    and fix it if someone is using it
+
+ glib/poppler-form-field.cc | 5 ++++-
+ poppler/Annot.cc           | 1 -
+ poppler/Annot.h            | 3 ---
+ poppler/Form.cc            | 4 ----
+ poppler/Form.h             | 2 --
+ 5 files changed, 4 insertions(+), 11 deletions(-)
+
+commit a613cd32bcaabe67649536886637ad022685c402
+Author: Albert Astals Cid <aacid at kde.org>
+Date:   Thu Apr 19 17:10:23 2018 +0200
+
+    Fix compilation with libc++
+
+ qt5/src/ArthurOutputDev.cc | 2 ++
+ 1 file changed, 2 insertions(+)
+
 commit 4d851d16aa6a2a9f00b60091a2ef810be1a571ea
 Author: Albert Astals Cid <aacid at kde.org>
 Date:   Tue Apr 17 20:04:26 2018 +0200

Modified: branches/stable/source/src/libs/poppler/poppler-src/NEWS
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/NEWS	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/NEWS	2018-07-10 17:26:48 UTC (rev 806)
@@ -1,3 +1,32 @@
+Release 0.66.0
+        core:
+         * Fix lots of security/leak issues found by oss-fuzz
+         * Splash: Optimize some files, making them 20% faster
+         * Splash: Correctly manipulate spot colors if SPOT_NCOMPS != 4
+         * Fix compilation with some strict compilers
+
+Release 0.65.0
+        core:
+         * SplashOutputDev: Add the invisible character check beginType3Char. Bug #106244
+         * XRef: Fix runtime undefined behaviour. Bug #105970
+         * Fix issues with malformed documents. Bug #104942, #103238
+         * Remove GooHash after replacing it by std::unordered_map
+         * Add conversion methods between GooString and std::string.
+
+        cpp:
+         * Add newline after error message
+         * Expose more image modes, add option to select mode in renderer. Bug #105558
+
+        build system:
+         * Fix compilation with libc++
+         * Small improvement to FindLIBOPENJPEG2.cmake
+
+        qt5:
+         * Add widget annot actions to FormFields
+
+        utils:
+         * pdffonts: Minor formatting changes in the man page. Bug #105194
+
 Release 0.64.0
         core:
          * Workaround form field text not being drawn on broken files. Bug #103245

Modified: branches/stable/source/src/libs/poppler/poppler-src/fofi/FoFiIdentifier.cc
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/fofi/FoFiIdentifier.cc	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/fofi/FoFiIdentifier.cc	2018-07-10 17:26:48 UTC (rev 806)
@@ -378,13 +378,12 @@
 }
 
 GBool StreamReader::cmp(int pos, const char *s) {
-  int n;
-
-  n = (int)strlen(s);
+  const int n = (int)strlen(s);
   if (!fillBuf(pos, n)) {
     return gFalse;
   }
-  return !memcmp(buf - bufPos + pos, s, n);
+  const int posDiff = pos - bufPos;
+  return !memcmp(buf + posDiff, s, n);
 }
 
 GBool StreamReader::fillBuf(int pos, int len) {

Modified: branches/stable/source/src/libs/poppler/poppler-src/fofi/FoFiTrueType.cc
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/fofi/FoFiTrueType.cc	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/fofi/FoFiTrueType.cc	2018-07-10 17:26:48 UTC (rev 806)
@@ -23,6 +23,7 @@
 // Copyright (C) 2014 Thomas Freitag <Thomas.Freitag at alfa.de>
 // Copyright (C) 2015 Aleksei Volkov <Aleksei Volkov>
 // Copyright (C) 2015, 2016 William Bader <williambader at hotmail.com>
+// Copyright (C) 2018 Adam Reichold <adam.reichold at t-online.de>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -43,7 +44,6 @@
 #include "goo/gmem.h"
 #include "goo/GooLikely.h"
 #include "goo/GooString.h"
-#include "goo/GooHash.h"
 #include "FoFiType1C.h"
 #include "FoFiTrueType.h"
 #include "poppler/Error.h"
@@ -305,7 +305,6 @@
   nTables = 0;
   cmaps = nullptr;
   nCmaps = 0;
-  nameToGID = nullptr;
   parsedOk = gFalse;
   faceIndex = faceIndexA;
   gsubFeatureTable = 0;
@@ -317,9 +316,6 @@
 FoFiTrueType::~FoFiTrueType() {
   gfree(tables);
   gfree(cmaps);
-  if (nameToGID) {
-    delete nameToGID;
-  }
 }
 
 int FoFiTrueType::getNumCmaps() {
@@ -442,11 +438,12 @@
   return gid;
 }
 
-int FoFiTrueType::mapNameToGID(char *name) {
-  if (!nameToGID) {
+int FoFiTrueType::mapNameToGID(char *name) const {
+  const auto gid = nameToGID.find(name);
+  if (gid == nameToGID.end()) {
     return 0;
   }
-  return nameToGID->lookupInt(name);
+  return gid->second;
 }
 
 GBool FoFiTrueType::getCFFBlock(char **start, int *length) {
@@ -1450,7 +1447,7 @@
 }
 
 void FoFiTrueType::readPostTable() {
-  GooString *name;
+  std::string name;
   int tablePos, postFmt, stringIdx, stringPos;
   GBool ok;
   int i, j, n, m;
@@ -1465,12 +1462,12 @@
     goto err;
   }
   if (postFmt == 0x00010000) {
-    nameToGID = new GooHash(gTrue);
+    nameToGID.reserve(258);
     for (i = 0; i < 258; ++i) {
-      nameToGID->add(new GooString(macGlyphNames[i]), i);
+      nameToGID.emplace(macGlyphNames[i], i);
     }
   } else if (postFmt == 0x00020000) {
-    nameToGID = new GooHash(gTrue);
+    nameToGID.reserve(258);
     n = getU16BE(tablePos + 32, &ok);
     if (!ok) {
       goto err;
@@ -1484,8 +1481,7 @@
       ok = gTrue;
       j = getU16BE(tablePos + 34 + 2*i, &ok);
       if (j < 258) {
-	nameToGID->removeInt(macGlyphNames[j]);
-	nameToGID->add(new GooString(macGlyphNames[j]), i);
+	nameToGID[macGlyphNames[j]] = i;
       } else {
 	j -= 258;
 	if (j != stringIdx) {
@@ -1500,15 +1496,14 @@
 	if (!ok || !checkRegion(stringPos + 1, m)) {
 	  continue;
 	}
-	name = new GooString((char *)&file[stringPos + 1], m);
-	nameToGID->removeInt(name);
-	nameToGID->add(name, i);
+	name.assign((char *)&file[stringPos + 1], m);
+	nameToGID[name] = i;
 	++stringIdx;
 	stringPos += 1 + m;
       }
     }
   } else if (postFmt == 0x00028000) {
-    nameToGID = new GooHash(gTrue);
+    nameToGID.reserve(258);
     for (i = 0; i < nGlyphs; ++i) {
       j = getU8(tablePos + 32 + i, &ok);
       if (!ok) {
@@ -1515,8 +1510,7 @@
 	continue;
       }
       if (j < 258) {
-	nameToGID->removeInt(macGlyphNames[j]);
-	nameToGID->add(new GooString(macGlyphNames[j]), i);
+	nameToGID[macGlyphNames[j]] = i;
       }
     }
   }
@@ -1524,10 +1518,7 @@
   return;
 
  err:
-  if (nameToGID) {
-    delete nameToGID;
-    nameToGID = nullptr;
-  }
+  nameToGID.clear();
 }
 
 int FoFiTrueType::seekTable(const char *tag) {

Modified: branches/stable/source/src/libs/poppler/poppler-src/fofi/FoFiTrueType.h
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/fofi/FoFiTrueType.h	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/fofi/FoFiTrueType.h	2018-07-10 17:26:48 UTC (rev 806)
@@ -18,6 +18,7 @@
 // Copyright (C) 2011, 2012 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2012 Suzuki Toshiya <mpsuzuki at hiroshima-u.ac.jp>
 // Copyright (C) 2016 William Bader <williambader at hotmail.com>
+// Copyright (C) 2018 Adam Reichold <adam.reichold at t-online.de>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -32,11 +33,12 @@
 #endif
 
 #include "stddef.h"
+#include <unordered_map>
+#include <string>
 #include "goo/gtypes.h"
 #include "FoFiBase.h"
 
 class GooString;
-class GooHash;
 struct TrueTypeTable;
 struct TrueTypeCmap;
 
@@ -82,7 +84,7 @@
   // Returns the GID corresponding to <name> according to the post
   // table.  Returns 0 if there is no mapping for <name> or if the
   // font does not have a post table.
-  int mapNameToGID(char *name);
+  int mapNameToGID(char *name) const;
 
   // Return the mapping from CIDs to GIDs, and return the number of
   // CIDs in *<nCIDs>.  This is only useful for CID fonts.  (Only
@@ -199,7 +201,7 @@
   int nGlyphs;
   int locaFmt;
   int bbox[4];
-  GooHash *nameToGID;
+  std::unordered_map<std::string,int> nameToGID;
   GBool openTypeCFF;
 
   GBool parsedOk;

Modified: branches/stable/source/src/libs/poppler/poppler-src/fofi/FoFiType1.cc
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/fofi/FoFiType1.cc	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/fofi/FoFiType1.cc	2018-07-10 17:26:48 UTC (rev 806)
@@ -226,9 +226,13 @@
        ++i) {
 
     // get font name
-    if (!name && !strncmp(line, "/FontName", 9)) {
-      strncpy(buf, line, 255);
-      buf[255] = '\0';
+    if (!name &&
+	(line + 9 <= (char*)file + len) &&
+	!strncmp(line, "/FontName", 9)) {
+      const auto availableFile = (char*)file + len - line;
+      const int lineLen = availableFile < 255 ? availableFile : 255;
+      strncpy(buf, line, lineLen);
+      buf[lineLen] = '\0';
       if ((p = strchr(buf+9, '/')) &&
 	  (p = strtok_r(p+1, " \t\n\r", &tokptr))) {
 	name = copyString(p);
@@ -237,9 +241,11 @@
 
     // get encoding
     } else if (!encoding &&
+	       (line + 30 <= (char*)file + len) &&
 	       !strncmp(line, "/Encoding StandardEncoding def", 30)) {
       encoding = (char **)fofiType1StandardEncoding;
     } else if (!encoding &&
+	       (line + 19 <= (char*)file + len) &&
 	       !strncmp(line, "/Encoding 256 array", 19)) {
       encoding = (char **)gmallocn(256, sizeof(char *));
       for (j = 0; j < 256; ++j) {
@@ -331,9 +337,13 @@
       }
       //~ check for getinterval/putinterval junk
 
-    } else if (!gotMatrix && !strncmp(line, "/FontMatrix", 11)) {
-      strncpy(buf, line + 11, 255);
-      buf[255] = '\0';
+    } else if (!gotMatrix &&
+	       (line + 11 <= (char*)file + len) &&
+	       !strncmp(line, "/FontMatrix", 11)) {
+      const auto availableFile = (char*)file + len - (line + 11);
+      const int bufLen = availableFile < 255 ? availableFile : 255;
+      strncpy(buf, line + 11, bufLen);
+      buf[bufLen] = '\0';
       if ((p = strchr(buf, '['))) {
 	++p;
 	if ((p2 = strchr(p, ']'))) {

Modified: branches/stable/source/src/libs/poppler/poppler-src/fofi/FoFiType1C.cc
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/fofi/FoFiType1C.cc	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/fofi/FoFiType1C.cc	2018-07-10 17:26:48 UTC (rev 806)
@@ -13,7 +13,7 @@
 // All changes made under the Poppler project to this file are licensed
 // under GPL version 2 or later
 //
-// Copyright (C) 2009, 2010, 2017 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2009, 2010, 2017, 2018 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2012 Thomas Freitag <Thomas.Freitag at alfa.de>
 //
 // To see a description of the changes please see the Changelog file that
@@ -32,6 +32,7 @@
 #include <math.h>
 #include "goo/gmem.h"
 #include "goo/gstrtod.h"
+#include "goo/GooLikely.h"
 #include "goo/GooString.h"
 #include "poppler/Error.h"
 #include "FoFiEncodings.h"
@@ -1361,7 +1362,7 @@
 	  --nOps;
 	  ok = gTrue;
 	  getIndexVal(subrIdx, k, &val, &ok);
-	  if (ok) {
+	  if (likely(ok && val.pos != offset)) {
 	    cvtGlyph(val.pos, val.len, charBuf, subrIdx, pDict, gFalse);
 	  }
 	} else {
@@ -1596,7 +1597,7 @@
 	  --nOps;
 	  ok = gTrue;
 	  getIndexVal(&gsubrIdx, k, &val, &ok);
-	  if (ok) {
+	  if (likely(ok && val.pos != offset)) {
 	    cvtGlyph(val.pos, val.len, charBuf, subrIdx, pDict, gFalse);
 	  }
 	} else {
@@ -2125,6 +2126,9 @@
   topDict.fdSelectOffset = 0;
 
   getIndexVal(&topDictIdx, 0, &topDictPtr, &parsedOk);
+  if (!parsedOk) {
+      return;
+  }
   pos = topDictPtr.pos;
   nOps = 0;
   while (pos < topDictPtr.pos + topDictPtr.len) {

Deleted: branches/stable/source/src/libs/poppler/poppler-src/goo/GooHash.cc
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/goo/GooHash.cc	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/goo/GooHash.cc	2018-07-10 17:26:48 UTC (rev 806)
@@ -1,403 +0,0 @@
-//========================================================================
-//
-// GooHash.cc
-//
-// Copyright 2001-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-//========================================================================
-//
-// Modified under the Poppler project - http://poppler.freedesktop.org
-//
-// All changes made under the Poppler project to this file are licensed
-// under GPL version 2 or later
-//
-// Copyright (C) 2017 Albert Astals Cid <aacid at kde.org>
-// Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info at kdab.com>. Work sponsored by the LiMux project of the city of Munich
-//
-// To see a description of the changes please see the Changelog file that
-// came with your tarball or type make ChangeLog if you are building from git
-//
-//========================================================================
-
-#include <config.h>
-
-#ifdef USE_GCC_PRAGMAS
-#pragma implementation
-#endif
-
-#include "gmem.h"
-#include "GooString.h"
-#include "GooHash.h"
-#include "GooLikely.h"
-
-//------------------------------------------------------------------------
-
-struct GooHashBucket {
-  GooString *key;
-  union {
-    void *p;
-    int i;
-  } val;
-  GooHashBucket *next;
-};
-
-struct GooHashIter {
-  int h;
-  GooHashBucket *p;
-};
-
-//------------------------------------------------------------------------
-
-GooHash::GooHash(GBool deleteKeysA) {
-  int h;
-
-  deleteKeys = deleteKeysA;
-  size = 7;
-  tab = (GooHashBucket **)gmallocn(size, sizeof(GooHashBucket *));
-  for (h = 0; h < size; ++h) {
-    tab[h] = nullptr;
-  }
-  len = 0;
-}
-
-GooHash::~GooHash() {
-  GooHashBucket *p;
-  int h;
-
-  for (h = 0; h < size; ++h) {
-    while (tab[h]) {
-      p = tab[h];
-      tab[h] = p->next;
-      if (deleteKeys) {
-	delete p->key;
-      }
-      delete p;
-    }
-  }
-  gfree(tab);
-}
-
-void GooHash::add(GooString *key, void *val) {
-  GooHashBucket *p;
-  int h;
-
-  // expand the table if necessary
-  if (len >= size) {
-    expand();
-  }
-
-  // add the new symbol
-  p = new GooHashBucket;
-  p->key = key;
-  p->val.p = val;
-  h = hash(key);
-  p->next = tab[h];
-  tab[h] = p;
-  ++len;
-}
-
-void GooHash::add(GooString *key, int val) {
-  GooHashBucket *p;
-  int h;
-
-  // expand the table if necessary
-  if (len >= size) {
-    expand();
-  }
-
-  // add the new symbol
-  p = new GooHashBucket;
-  p->key = key;
-  p->val.i = val;
-  h = hash(key);
-  p->next = tab[h];
-  tab[h] = p;
-  ++len;
-}
-
-void GooHash::replace(GooString *key, void *val) {
-  GooHashBucket *p;
-  int h;
-
-  if ((p = find(key, &h))) {
-    p->val.p = val;
-    if (deleteKeys) {
-      delete key;
-    }
-  } else {
-    add(key, val);
-  }
-}
-
-void GooHash::replace(GooString *key, int val) {
-  GooHashBucket *p;
-  int h;
-
-  if ((p = find(key, &h))) {
-    p->val.i = val;
-    if (deleteKeys) {
-      delete key;
-    }
-  } else {
-    add(key, val);
-  }
-}
-
-void *GooHash::lookup(GooString *key) {
-  GooHashBucket *p;
-  int h;
-
-  if (!(p = find(key, &h))) {
-    return nullptr;
-  }
-  return p->val.p;
-}
-
-int GooHash::lookupInt(const GooString *key) {
-  GooHashBucket *p;
-  int h;
-
-  if (!(p = find(key, &h))) {
-    return 0;
-  }
-  return p->val.i;
-}
-
-void *GooHash::lookup(const char *key) {
-  GooHashBucket *p;
-  int h;
-
-  if (!(p = find(key, &h))) {
-    return nullptr;
-  }
-  return p->val.p;
-}
-
-int GooHash::lookupInt(const char *key) {
-  GooHashBucket *p;
-  int h;
-
-  if (!(p = find(key, &h))) {
-    return 0;
-  }
-  return p->val.i;
-}
-
-void *GooHash::remove(GooString *key) {
-  GooHashBucket *p;
-  GooHashBucket **q;
-  void *val;
-  int h;
-
-  if (!(p = find(key, &h))) {
-    return nullptr;
-  }
-  q = &tab[h];
-  while (*q != p) {
-    q = &((*q)->next);
-  }
-  *q = p->next;
-  if (deleteKeys) {
-    delete p->key;
-  }
-  val = p->val.p;
-  delete p;
-  --len;
-  return val;
-}
-
-int GooHash::removeInt(GooString *key) {
-  GooHashBucket *p;
-  GooHashBucket **q;
-  int val;
-  int h;
-
-  if (!(p = find(key, &h))) {
-    return 0;
-  }
-  q = &tab[h];
-  while (*q != p) {
-    q = &((*q)->next);
-  }
-  *q = p->next;
-  if (deleteKeys) {
-    delete p->key;
-  }
-  val = p->val.i;
-  delete p;
-  --len;
-  return val;
-}
-
-void *GooHash::remove(const char *key) {
-  GooHashBucket *p;
-  GooHashBucket **q;
-  void *val;
-  int h;
-
-  if (!(p = find(key, &h))) {
-    return nullptr;
-  }
-  q = &tab[h];
-  while (*q != p) {
-    q = &((*q)->next);
-  }
-  *q = p->next;
-  if (deleteKeys) {
-    delete p->key;
-  }
-  val = p->val.p;
-  delete p;
-  --len;
-  return val;
-}
-
-int GooHash::removeInt(const char *key) {
-  GooHashBucket *p;
-  GooHashBucket **q;
-  int val;
-  int h;
-
-  if (!(p = find(key, &h))) {
-    return 0;
-  }
-  q = &tab[h];
-  while (*q != p) {
-    q = &((*q)->next);
-  }
-  *q = p->next;
-  if (deleteKeys) {
-    delete p->key;
-  }
-  val = p->val.i;
-  delete p;
-  --len;
-  return val;
-}
-
-void GooHash::startIter(GooHashIter **iter) {
-  *iter = new GooHashIter;
-  (*iter)->h = -1;
-  (*iter)->p = nullptr;
-}
-
-GBool GooHash::getNext(GooHashIter **iter, GooString **key, void **val) {
-  if (!*iter) {
-    return gFalse;
-  }
-  if ((*iter)->p) {
-    (*iter)->p = (*iter)->p->next;
-  }
-  while (!(*iter)->p) {
-    if (++(*iter)->h == size) {
-      delete *iter;
-      *iter = nullptr;
-      return gFalse;
-    }
-    (*iter)->p = tab[(*iter)->h];
-  }
-  *key = (*iter)->p->key;
-  *val = (*iter)->p->val.p;
-  return gTrue;
-}
-
-GBool GooHash::getNext(GooHashIter **iter, GooString **key, int *val) {
-  if (!*iter) {
-    return gFalse;
-  }
-  if ((*iter)->p) {
-    (*iter)->p = (*iter)->p->next;
-  }
-  while (!(*iter)->p) {
-    if (++(*iter)->h == size) {
-      delete *iter;
-      *iter = nullptr;
-      return gFalse;
-    }
-    (*iter)->p = tab[(*iter)->h];
-  }
-  *key = (*iter)->p->key;
-  *val = (*iter)->p->val.i;
-  return gTrue;
-}
-
-void GooHash::killIter(GooHashIter **iter) {
-  delete *iter;
-  *iter = nullptr;
-}
-
-void GooHash::expand() {
-  GooHashBucket **oldTab;
-  GooHashBucket *p;
-  int oldSize, h, i;
-
-  oldSize = size;
-  oldTab = tab;
-  size = 2*size + 1;
-  tab = (GooHashBucket **)gmallocn(size, sizeof(GooHashBucket *));
-  for (h = 0; h < size; ++h) {
-    tab[h] = nullptr;
-  }
-  for (i = 0; i < oldSize; ++i) {
-    while (oldTab[i]) {
-      p = oldTab[i];
-      oldTab[i] = oldTab[i]->next;
-      h = hash(p->key);
-      p->next = tab[h];
-      tab[h] = p;
-    }
-  }
-  gfree(oldTab);
-}
-
-GooHashBucket *GooHash::find(const GooString *key, int *h) {
-  GooHashBucket *p;
-
-  if (unlikely(!key))
-    return nullptr;
-
-  *h = hash(key);
-  for (p = tab[*h]; p; p = p->next) {
-    if (!p->key->cmp(key)) {
-      return p;
-    }
-  }
-  return nullptr;
-}
-
-GooHashBucket *GooHash::find(const char *key, int *h) {
-  GooHashBucket *p;
-
-  *h = hash(key);
-  for (p = tab[*h]; p; p = p->next) {
-    if (!p->key->cmp(key)) {
-      return p;
-    }
-  }
-  return nullptr;
-}
-
-int GooHash::hash(const GooString *key) {
-  const char *p;
-  unsigned int h;
-  int i;
-
-  h = 0;
-  for (p = key->getCString(), i = 0; i < key->getLength(); ++p, ++i) {
-    h = 17 * h + (int)(*p & 0xff);
-  }
-  return (int)(h % size);
-}
-
-int GooHash::hash(const char *key) {
-  const char *p;
-  unsigned int h;
-
-  h = 0;
-  for (p = key; *p; ++p) {
-    h = 17 * h + (int)(*p & 0xff);
-  }
-  return (int)(h % size);
-}

Deleted: branches/stable/source/src/libs/poppler/poppler-src/goo/GooHash.h
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/goo/GooHash.h	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/goo/GooHash.h	2018-07-10 17:26:48 UTC (rev 806)
@@ -1,93 +0,0 @@
-//========================================================================
-//
-// GooHash.h
-//
-// Copyright 2001-2003 Glyph & Cog, LLC
-//
-//========================================================================
-
-//========================================================================
-//
-// Modified under the Poppler project - http://poppler.freedesktop.org
-//
-// All changes made under the Poppler project to this file are licensed
-// under GPL version 2 or later
-//
-// Copyright (C) 2012 Albert Astals Cid <aacid at kde.org>
-// Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info at kdab.com>. Work sponsored by the LiMux project of the city of Munich
-//
-// To see a description of the changes please see the Changelog file that
-// came with your tarball or type make ChangeLog if you are building from git
-//
-//========================================================================
-
-#ifndef GHASH_H
-#define GHASH_H
-
-#ifdef USE_GCC_PRAGMAS
-#pragma interface
-#endif
-
-#include "gtypes.h"
-
-class GooString;
-struct GooHashBucket;
-struct GooHashIter;
-
-//------------------------------------------------------------------------
-
-class GooHash {
-public:
-
-  GooHash(GBool deleteKeysA = gFalse);
-  ~GooHash();
-  void add(GooString *key, void *val);
-  void add(GooString *key, int val);
-  void replace(GooString *key, void *val);
-  void replace(GooString *key, int val);
-  void *lookup(GooString *key);
-  int lookupInt(const GooString *key);
-  void *lookup(const char *key);
-  int lookupInt(const char *key);
-  void *remove(GooString *key);
-  int removeInt(GooString *key);
-  void *remove(const char *key);
-  int removeInt(const char *key);
-  int getLength() { return len; }
-  void startIter(GooHashIter **iter);
-  GBool getNext(GooHashIter **iter, GooString **key, void **val);
-  GBool getNext(GooHashIter **iter, GooString **key, int *val);
-  void killIter(GooHashIter **iter);
-
-private:
-  GooHash(const GooHash &other);
-  GooHash& operator=(const GooHash &other);
-
-  void expand();
-  GooHashBucket *find(const GooString *key, int *h);
-  GooHashBucket *find(const char *key, int *h);
-  int hash(const GooString *key);
-  int hash(const char *key);
-
-  GBool deleteKeys;		// set if key strings should be deleted
-  int size;			// number of buckets
-  int len;			// number of entries
-  GooHashBucket **tab;
-};
-
-#define deleteGooHash(hash, T)                       \
-  do {                                             \
-    GooHash *_hash = (hash);                         \
-    {                                              \
-      GooHashIter *_iter;                            \
-      GooString *_key;                               \
-      void *_p;                                    \
-      _hash->startIter(&_iter);                    \
-      while (_hash->getNext(&_iter, &_key, &_p)) { \
-        delete (T*)_p;                             \
-      }                                            \
-      delete _hash;                                \
-    }                                              \
-  } while(0)
-
-#endif

Modified: branches/stable/source/src/libs/poppler/poppler-src/goo/GooString.h
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/goo/GooString.h	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/goo/GooString.h	2018-07-10 17:26:48 UTC (rev 806)
@@ -20,7 +20,7 @@
 // Copyright (C) 2008-2010, 2012, 2014, 2017 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2012-2014 Fabio D'Urso <fabiodurso at hotmail.it>
 // Copyright (C) 2013 Jason Crain <jason at aquaticape.us>
-// Copyright (C) 2015 Adam Reichold <adam.reichold at t-online.de>
+// Copyright (C) 2015, 2018 Adam Reichold <adam.reichold at t-online.de>
 // Copyright (C) 2016 Jakub Alba <jakubalba at gmail.com>
 // Copyright (C) 2017 Adrian Johnson <ajohnson at redneon.com>
 // Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info at kdab.com>. Work sponsored by the LiMux project of the city of Munich
@@ -39,6 +39,7 @@
 
 #include <stdarg.h>
 #include <stdlib.h> // for NULL
+#include <string>
 #include "gtypes.h"
 
 #ifdef __clang__
@@ -171,6 +172,10 @@
   // The caller owns the return value
   GooString *sanitizedName(GBool psmode) const;
 
+  // Conversion from and to std::string
+  explicit GooString(const std::string& str) : GooString(str.data(), str.size()) {}
+  std::string toStr() const { return std::string(getCString(), getLength()); }
+
 private:
   GooString(const GooString &other);
   GooString& operator=(const GooString &other);

Modified: branches/stable/source/src/libs/poppler/poppler-src/goo/gmem.cc
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/goo/gmem.cc	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/goo/gmem.cc	2018-07-10 17:26:48 UTC (rev 806)
@@ -178,17 +178,15 @@
 }
 
 inline static void *gmallocn(int nObjs, int objSize, bool checkoverflow) {
-  int n;
-
   if (nObjs == 0) {
     return nullptr;
   }
-  n = nObjs * objSize;
   if (objSize <= 0 || nObjs < 0 || nObjs >= INT_MAX / objSize) {
     fprintf(stderr, "Bogus memory allocation size\n");
     if (checkoverflow) return nullptr;
     else exit(1);
   }
+  const int n = nObjs * objSize;
   return gmalloc(n, checkoverflow);
 }
 
@@ -219,8 +217,6 @@
 }
 
 inline static void *greallocn(void *p, int nObjs, int objSize, bool checkoverflow) {
-  int n;
-
   if (nObjs == 0) {
     if (p) {
       gfree(p);
@@ -227,7 +223,6 @@
     }
     return nullptr;
   }
-  n = nObjs * objSize;
   if (objSize <= 0 || nObjs < 0 || nObjs >= INT_MAX / objSize) {
     fprintf(stderr, "Bogus memory allocation size\n");
     if (checkoverflow) {
@@ -237,6 +232,7 @@
       exit(1);
     }
   }
+  const int n = nObjs * objSize;
   return grealloc(p, n, checkoverflow);
 }
 

Modified: branches/stable/source/src/libs/poppler/poppler-src/poppler/Annot.cc
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/poppler/Annot.cc	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/poppler/Annot.cc	2018-07-10 17:26:48 UTC (rev 806)
@@ -1203,7 +1203,6 @@
   appearStreams = nullptr;
   appearBBox = nullptr;
   appearState = nullptr;
-  fontSize = 0;
 
   appearance.setToNull();
 

Modified: branches/stable/source/src/libs/poppler/poppler-src/poppler/Annot.h
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/poppler/Annot.h	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/poppler/Annot.h	2018-07-10 17:26:48 UTC (rev 806)
@@ -635,8 +635,6 @@
   double getXMax();
   double getYMax();
 
-  double getFontSize() { return fontSize; }
-
   void setRect(PDFRectangle *rect);
   void setRect(double x1, double y1, double x2, double y2);
 
@@ -734,7 +732,6 @@
   Ref ref;                      // object ref identifying this annotation
   AnnotBorder *border;          // Border, BS
   AnnotColor *color;            // C
-  double fontSize; 
   GBool ok;
 
   bool hasRef;

Modified: branches/stable/source/src/libs/poppler/poppler-src/poppler/Array.cc
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/poppler/Array.cc	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/poppler/Array.cc	2018-07-10 17:26:48 UTC (rev 806)
@@ -112,7 +112,7 @@
 #endif
   }
   --length;
-  memmove( elems + i, elems + i + 1, sizeof(elems[0]) * (length - i) );
+  memmove( static_cast<void*>(elems + i), elems + i + 1, sizeof(elems[0]) * (length - i) );
 }
 
 Object Array::get(int i, int recursion) const {

Modified: branches/stable/source/src/libs/poppler/poppler-src/poppler/CMap.cc
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/poppler/CMap.cc	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/poppler/CMap.cc	2018-07-10 17:26:48 UTC (rev 806)
@@ -234,7 +234,7 @@
   PSTokenizer *pst;
   char tok1[256], tok2[256], tok3[256];
   int n1, n2, n3;
-  Guint start, end, code;
+  Guint start = 0, end = 0, code;
 
   pst = new PSTokenizer(getCharFunc, data);
   pst->getToken(tok1, sizeof(tok1), &n1);

Modified: branches/stable/source/src/libs/poppler/poppler-src/poppler/CharCodeToUnicode.cc
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/poppler/CharCodeToUnicode.cc	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/poppler/CharCodeToUnicode.cc	2018-07-10 17:26:48 UTC (rev 806)
@@ -26,6 +26,7 @@
 // Copyright (C) 2015 Marek Kasik <mkasik at redhat.com>
 // Copyright (C) 2017 Jean Ghali <jghali at libertysurf.fr>
 // Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info at kdab.com>. Work sponsored by the LiMux project of the city of Munich
+// Copyright (C) 2018 Adam Reichold <adam.reichold at t-online.de>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -126,7 +127,7 @@
   return ctu;
 }
 
-CharCodeToUnicode *CharCodeToUnicode::parseCIDToUnicode(GooString *fileName,
+CharCodeToUnicode *CharCodeToUnicode::parseCIDToUnicode(const char *fileName,
 							GooString *collection) {
   FILE *f;
   Unicode *mapA;
@@ -135,8 +136,8 @@
   Unicode u;
   CharCodeToUnicode *ctu;
 
-  if (!(f = openFile(fileName->getCString(), "r"))) {
-    error(errIO, -1, "Couldn't open cidToUnicode file '{0:t}'",
+  if (!(f = openFile(fileName, "r"))) {
+    error(errIO, -1, "Couldn't open cidToUnicode file '{0:s}'",
 	  fileName);
     return nullptr;
   }
@@ -153,7 +154,7 @@
     if (sscanf(buf, "%x", &u) == 1) {
       mapA[mapLenA] = u;
     } else {
-      error(errSyntaxWarning, -1, "Bad line ({0:d}) in cidToUnicode file '{1:t}'",
+      error(errSyntaxWarning, -1, "Bad line ({0:d}) in cidToUnicode file '{1:s}'",
 	    (int)(mapLenA + 1), fileName);
       mapA[mapLenA] = 0;
     }

Modified: branches/stable/source/src/libs/poppler/poppler-src/poppler/CharCodeToUnicode.h
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/poppler/CharCodeToUnicode.h	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/poppler/CharCodeToUnicode.h	2018-07-10 17:26:48 UTC (rev 806)
@@ -20,6 +20,7 @@
 // Copyright (C) 2008, 2011, 2012, 2018 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2017 Adrian Johnson <ajohnson at redneon.com>
 // Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info at kdab.com>. Work sponsored by the LiMux project of the city of Munich
+// Copyright (C) 2018 Adam Reichold <adam.reichold at t-online.de>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -56,7 +57,7 @@
   // Read the CID-to-Unicode mapping for <collection> from the file
   // specified by <fileName>.  Sets the initial reference count to 1.
   // Returns NULL on failure.
-  static CharCodeToUnicode *parseCIDToUnicode(GooString *fileName,
+  static CharCodeToUnicode *parseCIDToUnicode(const char *fileName,
 					      GooString *collection);
 
   // Create a Unicode-to-Unicode mapping from the file specified by

Modified: branches/stable/source/src/libs/poppler/poppler-src/poppler/Decrypt.cc
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/poppler/Decrypt.cc	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/poppler/Decrypt.cc	2018-07-10 17:26:48 UTC (rev 806)
@@ -311,22 +311,26 @@
 				 int keyLength, int objNum, int objGen):
   FilterStream(strA)
 {
-  int i;
-
   algo = algoA;
 
   // construct object key
-  for (i = 0; i < keyLength; ++i) {
+  for (int i = 0; i < keyLength; ++i) {
     objKey[i] = fileKey[i];
   }
+  for (std::size_t i = keyLength; i < sizeof(objKey); ++i) {
+    objKey[i] = 0;
+  }
+
   switch (algo) {
   case cryptRC4:
-    objKey[keyLength] = objNum & 0xff;
-    objKey[keyLength + 1] = (objNum >> 8) & 0xff;
-    objKey[keyLength + 2] = (objNum >> 16) & 0xff;
-    objKey[keyLength + 3] = objGen & 0xff;
-    objKey[keyLength + 4] = (objGen >> 8) & 0xff;
-    md5(objKey, keyLength + 5, objKey);
+    if (likely(keyLength < static_cast<int>(sizeof(objKey) - 4))) {
+      objKey[keyLength] = objNum & 0xff;
+      objKey[keyLength + 1] = (objNum >> 8) & 0xff;
+      objKey[keyLength + 2] = (objNum >> 16) & 0xff;
+      objKey[keyLength + 3] = objGen & 0xff;
+      objKey[keyLength + 4] = (objGen >> 8) & 0xff;
+      md5(objKey, keyLength + 5, objKey);
+    }
     if ((objKeyLength = keyLength + 5) > 16) {
       objKeyLength = 16;
     }
@@ -1148,7 +1152,7 @@
 }
 
 void md5(Guchar *msg, int msgLen, Guchar *digest) {
-  Gulong x[16];
+  Gulong x[16] = {};
   Gulong a, b, c, d, aa, bb, cc, dd;
   int n64;
   int i, j, k;

Modified: branches/stable/source/src/libs/poppler/poppler-src/poppler/Dict.cc
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/poppler/Dict.cc	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/poppler/Dict.cc	2018-07-10 17:26:48 UTC (rev 806)
@@ -201,7 +201,7 @@
       gfree(entries[pos].key);
       entries[pos].val.free();
       if (pos != length) {
-        memmove(&entries[pos], &entries[pos + 1], (length - pos) * sizeof(DictEntry));
+        memmove(static_cast<void*>(&entries[pos]), &entries[pos + 1], (length - pos) * sizeof(DictEntry));
       }
     }
   } else {

Modified: branches/stable/source/src/libs/poppler/poppler-src/poppler/Form.cc
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/poppler/Form.cc	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/poppler/Form.cc	2018-07-10 17:26:48 UTC (rev 806)
@@ -129,10 +129,6 @@
     widget->getRect(x1, y1, x2, y2);
 }
 
-double FormWidget::getFontSize() const {
-  return widget ? widget->getFontSize() : 0.;
-}
-
 bool FormWidget::isReadOnly() const
 {
   return field->isReadOnly();

Modified: branches/stable/source/src/libs/poppler/poppler-src/poppler/Form.h
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/poppler/Form.h	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/poppler/Form.h	2018-07-10 17:26:48 UTC (rev 806)
@@ -111,8 +111,6 @@
   void setChildNum (unsigned i) { childNum = i; }
   unsigned getChildNum () { return childNum; }
 
-  double getFontSize() const;
-
   const GooString *getPartialName() const;
   void setPartialName(const GooString &name);
   const GooString *getAlternateUiName() const;

Modified: branches/stable/source/src/libs/poppler/poppler-src/poppler/Function.cc
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/poppler/Function.cc	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/poppler/Function.cc	2018-07-10 17:26:48 UTC (rev 806)
@@ -13,7 +13,7 @@
 // All changes made under the Poppler project to this file are licensed
 // under GPL version 2 or later
 //
-// Copyright (C) 2006, 2008-2010, 2013-2015, 2017 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2006, 2008-2010, 2013-2015, 2017, 2018 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2006 Jeff Muizelaar <jeff at infidigm.net>
 // Copyright (C) 2010 Christian Feuers\xE4nger <cfeuersaenger at googlemail.com>
 // Copyright (C) 2011 Andrea Canciani <ranma42 at gmail.com>
@@ -295,6 +295,10 @@
     return;
   }
   sampleBits = obj1.getInt();
+  if (unlikely(sampleBits < 1 || sampleBits > 32)) {
+    error(errSyntaxError, -1, "Function invalid BitsPerSample");
+    return;
+  }
   sampleMul = 1.0 / (pow(2.0, (double)sampleBits) - 1);
 
   //----- Encode
@@ -321,6 +325,10 @@
     }
   }
   for (i = 0; i < m; ++i) {
+    if (unlikely((domain[i][1] - domain[i][0]) == 0)) {
+      error(errSyntaxError, -1, "Illegal value in function domain array");
+      return;
+    }
     inputMul[i] = (encode[i][1] - encode[i][0]) /
                   (domain[i][1] - domain[i][0]);
   }
@@ -1295,6 +1303,7 @@
       if (!tok->cmp("{")) {
 	elsePtr = *codePtr;
 	if (!parseCode(str, codePtr)) {
+	  delete tok;
 	  return gFalse;
 	}
 	delete tok;

Modified: branches/stable/source/src/libs/poppler/poppler-src/poppler/Gfx.cc
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/poppler/Gfx.cc	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/poppler/Gfx.cc	2018-07-10 17:26:48 UTC (rev 806)
@@ -39,6 +39,7 @@
 // Copyright (C) 2012 Lu Wang <coolwanglu at gmail.com>
 // Copyright (C) 2014 Jason Crain <jason at aquaticape.us>
 // Copyright (C) 2017, 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info at kdab.com>. Work sponsored by the LiMux project of the city of Munich
+// Copyright (C) 2018 Adam Reichold <adam.reichold at t-online.de>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -59,7 +60,6 @@
 #include <memory>
 #include "goo/gmem.h"
 #include "goo/GooTimer.h"
-#include "goo/GooHash.h"
 #include "GlobalParams.h"
 #include "CharTypes.h"
 #include "Object.h"
@@ -748,21 +748,9 @@
 
       // Update the profile information
       if (unlikely(profileCommands)) {
-	GooHash *hash;
-
-	hash = out->getProfileHash ();
-	if (hash) {
-	  GooString *cmd_g;
-	  ProfileData *data_p;
-
-	  cmd_g = new GooString (obj.getCmd());
-	  data_p = (ProfileData *)hash->lookup (cmd_g);
-	  if (data_p == nullptr) {
-	    data_p = new ProfileData();
-	    hash->add (cmd_g, data_p);
-	  }
-	  
-	  data_p->addElement(timer->getElapsed ());
+	if (auto* const hash = out->getProfileHash()) {
+	  auto& data = (*hash)[obj.getCmd()];
+	  data.addElement(timer->getElapsed());
 	}
 	delete timer;
       }
@@ -959,11 +947,10 @@
     dash = nullptr;
   } else {
     dash = (double *)gmallocn(length, sizeof(double));
+    bool dummyOk;
     for (i = 0; i < length; ++i) {
-      Object obj = a->get(i);
-      if (obj.isNum()) {
-	dash[i] = obj.getNum();
-      }
+      const Object obj = a->get(i);
+      dash[i] = obj.getNum(&dummyOk);
     }
   }
   state->setLineDash(dash, length, args[1].getNum());
@@ -1002,7 +989,6 @@
   Function *funcs[4];
   GfxColor backdropColor;
   GBool haveBackdropColor;
-  GfxColorSpace *blendingColorSpace;
   GBool alpha, isolated, knockout;
   double opac;
   int i;
@@ -1209,7 +1195,7 @@
       if (obj3.isStream()) {
 	Object obj4 = obj3.streamGetDict()->lookup("Group");
 	if (obj4.isDict()) {
-	  blendingColorSpace = nullptr;
+	  GfxColorSpace *blendingColorSpace = nullptr;
 	  isolated = knockout = gFalse;
 	  Object obj5 = obj4.dictLookup("CS");
 	  if (!obj5.isNull()) {
@@ -1235,9 +1221,7 @@
 	  }
 	  doSoftMask(&obj3, alpha, blendingColorSpace,
 		     isolated, knockout, funcs[0], &backdropColor);
-	  if (funcs[0]) {
-	    delete funcs[0];
-	  }
+	  delete blendingColorSpace;
 	} else {
 	  error(errSyntaxError, getPos(), "Invalid soft mask in ExtGState - missing group");
 	}
@@ -1244,6 +1228,7 @@
       } else {
 	error(errSyntaxError, getPos(), "Invalid soft mask in ExtGState - missing group");
       }
+      delete funcs[0];
     } else if (!obj2.isNull()) {
       error(errSyntaxError, getPos(), "Invalid soft mask in ExtGState");
     }
@@ -1369,10 +1354,6 @@
 	  blendingColorSpace, isolated, knockout,
 	  alpha, transferFunc, backdropColor);
   --formDepth;
-
-  if (blendingColorSpace) {
-    delete blendingColorSpace;
-  }
 }
 
 void Gfx::opSetRenderingIntent(Object args[], int numArgs) {
@@ -2622,7 +2603,7 @@
   double t0, t1, tt;
   double ta[axialMaxSplits + 1];
   int next[axialMaxSplits + 1];
-  GfxColor color0, color1;
+  GfxColor color0 = {}, color1 = {};
   int nComps;
   int i, j, k;
   GBool needExtend = gTrue;
@@ -2922,7 +2903,7 @@
   double xMin, yMin, xMax, yMax;
   double x0, y0, r0, x1, y1, r1, t0, t1;
   int nComps;
-  GfxColor colorA, colorB;
+  GfxColor colorA = {}, colorB = {}, colorC = {};
   double xa, ya, xb, yb, ra, rb;
   double ta, tb, sa, sb;
   double sz, xz, yz, sMin, sMax;
@@ -2953,7 +2934,12 @@
     xz = x0 + sz * (x1 - x0);
     yz = y0 + sz * (y1 - y0);
     enclosed = (xz - x0) * (xz - x0) + (yz - y0) * (yz - y0) <= r0 * r0;
-    theta = asin(r0 / sqrt((x0 - xz) * (x0 - xz) + (y0 - yz) * (y0 - yz)));
+    const double theta_aux = sqrt((x0 - xz) * (x0 - xz) + (y0 - yz) * (y0 - yz));
+    if (likely(theta_aux != 0)) {
+      theta = asin(r0 / theta_aux);
+    } else {
+      theta = 0;
+    }
     if (r0 > r1) {
       theta = -theta;
     }
@@ -3093,7 +3079,6 @@
         // same color does not mean all the areas in between have the same color too
         int ic = ia + 1;
         for (; ic <= ib; ic++) {
-          GfxColor colorC;
           const double sc = sMin + ((double)ic / (double)radialMaxSplits) * (sMax - sMin);
           const double tc = t0 + sc * (t1 - t0);
           getShadingColorRadialHelper(t0, t1, tc, shading, &colorC);
@@ -4469,6 +4454,7 @@
       }
       maskColorSpace = GfxColorSpace::parse(nullptr, &obj1, out, state);
       if (!maskColorSpace || maskColorSpace->getMode() != csDeviceGray) {
+	delete maskColorSpace;
 	goto err1;
       }
       obj1 = maskDict->lookup("Decode");

Modified: branches/stable/source/src/libs/poppler/poppler-src/poppler/GfxFont.cc
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/poppler/GfxFont.cc	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/poppler/GfxFont.cc	2018-07-10 17:26:48 UTC (rev 806)
@@ -960,7 +960,6 @@
   GBool missing, hex;
   GBool numeric;
   Unicode toUnicode[256];
-  CharCodeToUnicode *utu, *ctu2;
   Unicode uBuf[8];
   double mul;
   int firstChar, lastChar;
@@ -1326,27 +1325,6 @@
   // holes
   readToUnicodeCMap(fontDict, 16, ctu);
 
-  // look for a Unicode-to-Unicode mapping
-  if (name && (utu = globalParams->getUnicodeToUnicode(name))) {
-    Unicode *uAux;
-    for (i = 0; i < 256; ++i) {
-      toUnicode[i] = 0;
-    }
-    ctu2 = CharCodeToUnicode::make8BitToUnicode(toUnicode);
-    for (i = 0; i < 256; ++i) {
-      n = ctu->mapToUnicode((CharCode)i, &uAux);
-      if (n >= 1) {
-	n = utu->mapToUnicode((CharCode)uAux[0], &uAux);
-	if (n >= 1) {
-	  ctu2->setMapping((CharCode)i, uAux, n);
-	}
-      }
-    }
-    utu->decRefCnt();
-    delete ctu;
-    ctu = ctu2;
-  }
-
   //----- get the character widths -----
 
   // initialize all widths
@@ -1744,11 +1722,8 @@
   Dict *desFontDict;
   Object desFontDictObj;
   Object obj1, obj2, obj3, obj4, obj5, obj6;
-  CharCodeToUnicode *utu;
-  CharCode c;
-  Unicode *uBuf;
   int c1, c2;
-  int excepsSize, j, k, n;
+  int excepsSize, j, k;
 
   refCnt = 1;
   ascent = 0.95;
@@ -1838,24 +1813,6 @@
     }
   }
 
-  // look for a Unicode-to-Unicode mapping
-  if (name && (utu = globalParams->getUnicodeToUnicode(name))) {
-    if (ctu) {
-      for (c = 0; c < ctu->getLength(); ++c) {
-	n = ctu->mapToUnicode(c, &uBuf);
-	if (n >= 1) {
-	  n = utu->mapToUnicode((CharCode)uBuf[0], &uBuf);
-	  if (n >= 1) {
-	    ctu->setMapping(c, uBuf, n);
-	  }
-	}
-      }
-      utu->decRefCnt();
-    } else {
-      ctu = utu;
-    }
-  }
-
   // encoding (i.e., CMap)
   obj1 = fontDict->lookup("Encoding");
   if (obj1.isNull()) {

Modified: branches/stable/source/src/libs/poppler/poppler-src/poppler/GfxState.cc
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/poppler/GfxState.cc	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/poppler/GfxState.cc	2018-07-10 17:26:48 UTC (rev 806)
@@ -72,9 +72,13 @@
 
 GBool Matrix::invertTo(Matrix *other) const
 {
-  double det;
+  const double det_denominator = determinant();
+  if (unlikely(det_denominator == 0)) {
+      *other = {1, 0, 0, 1, 0, 0};
+      return gFalse;
+  }
 
-  det = 1 / determinant();
+  const double det = 1 / det_denominator;
   other->m[0] = m[3] * det;
   other->m[1] = -m[1] * det;
   other->m[2] = -m[2] * det;
@@ -2812,9 +2816,15 @@
   } else {
     x = colToDbl(color->c[0]);
     func->transform(&x, c);
-    for (i = 0; i < alt->getNComps(); ++i) {
+    const int altNComps = alt->getNComps();
+    for (i = 0; i < altNComps; ++i) {
       color2.c[i] = dblToCol(c[i]);
     }
+    if (unlikely(altNComps > func->getOutputSize())) {
+      for (i = func->getOutputSize(); i < altNComps; ++i) {
+	color2.c[i] = 0;
+      }
+    }
     alt->getRGB(&color2, rgb);
   }
 }
@@ -3887,7 +3897,7 @@
   gfree (cacheBounds);
 }
 
-void GfxUnivariateShading::getColor(double t, GfxColor *color) {
+int GfxUnivariateShading::getColor(double t, GfxColor *color) {
   double out[gfxColorMaxComps];
 
   // NB: there can be one function with n outputs or n functions with
@@ -3897,7 +3907,7 @@
   if (unlikely(nFuncs < 1 || nComps > gfxColorMaxComps)) {
     for (int i = 0; i < gfxColorMaxComps; i++)
         color->c[i] = 0;
-    return;
+    return gfxColorMaxComps;
   }
 
   if (cacheSize > 0) {
@@ -3937,6 +3947,7 @@
   for (int i = 0; i < nComps; ++i) {
     color->c[i] = dblToCol(out[i]);
   }
+  return nComps;
 }
 
 void GfxUnivariateShading::setupCache(const Matrix *ctm,
@@ -4059,7 +4070,6 @@
   int nFuncsA;
   GBool extend0A, extend1A;
   Object obj1;
-  int i;
 
   x0A = y0A = x1A = y1A = 0;
   obj1 = dict->lookup("Coords");
@@ -4098,9 +4108,11 @@
       error(errSyntaxWarning, -1, "Invalid Function array in shading dictionary");
       return nullptr;
     }
-    for (i = 0; i < nFuncsA; ++i) {
+    for (int i = 0; i < nFuncsA; ++i) {
       Object obj2 = obj1.arrayGet(i);
       if (!(funcsA[i] = Function::parse(&obj2))) {
+	for (int j = 0; j < i; ++j)
+	  delete funcsA[j];
 	return nullptr;
       }
     }
@@ -4172,7 +4184,13 @@
 
   pdx = x1 - x0;
   pdy = y1 - y0;
-  invsqnorm = 1.0 / (pdx * pdx + pdy * pdy);
+  const double invsqnorm_denominator = (pdx * pdx + pdy * pdy);
+  if (unlikely(invsqnorm_denominator == 0)) {
+    *lower = 0;
+    *upper = 0;
+    return;
+  }
+  invsqnorm = 1.0 / invsqnorm_denominator;
   pdx *= invsqnorm;
   pdy *= invsqnorm;
 
@@ -4771,6 +4789,10 @@
     error(errSyntaxWarning, -1, "Missing or invalid BitsPerCoordinate in shading dictionary");
     return nullptr;
   }
+  if (unlikely(coordBits <= 0)) {
+    error(errSyntaxWarning, -1, "Invalid BitsPerCoordinate in shading dictionary");
+    return nullptr;
+  }
   obj1 = dict->lookup("BitsPerComponent");
   if (obj1.isInt()) {
     compBits = obj1.getInt();
@@ -4778,6 +4800,10 @@
     error(errSyntaxWarning, -1, "Missing or invalid BitsPerComponent in shading dictionary");
     return nullptr;
   }
+  if (unlikely(compBits <= 0 || compBits > 31)) {
+    error(errSyntaxWarning, -1, "Invalid BitsPerComponent in shading dictionary");
+    return nullptr;
+  }
   flagBits = vertsPerRow = 0; // make gcc happy
   if (typeA == 4) {
     obj1 = dict->lookup("BitsPerFlag");
@@ -4809,7 +4835,7 @@
     for (i = 0; 5 + 2*i < obj1.arrayGetLength() && i < gfxColorMaxComps; ++i) {
       cMin[i] = (obj2 = obj1.arrayGet(4 + 2*i), obj2.getNum(&decodeOk));
       cMax[i] = (obj2 = obj1.arrayGet(5 + 2*i), obj2.getNum(&decodeOk));
-      cMul[i] = (cMax[i] - cMin[i]) / (double)((1 << compBits) - 1);
+      cMul[i] = (cMax[i] - cMin[i]) / (double)((1u << compBits) - 1);
     }
     nComps = i;
 
@@ -5119,6 +5145,10 @@
     error(errSyntaxWarning, -1, "Missing or invalid BitsPerCoordinate in shading dictionary");
     return nullptr;
   }
+  if (unlikely(coordBits <= 0)) {
+    error(errSyntaxWarning, -1, "Invalid BitsPerCoordinate in shading dictionary");
+    return nullptr;
+  }
   obj1 = dict->lookup("BitsPerComponent");
   if (obj1.isInt()) {
     compBits = obj1.getInt();
@@ -5126,6 +5156,10 @@
     error(errSyntaxWarning, -1, "Missing or invalid BitsPerComponent in shading dictionary");
     return nullptr;
   }
+  if (unlikely(compBits <= 0 || compBits > 31)) {
+    error(errSyntaxWarning, -1, "Invalid BitsPerComponent in shading dictionary");
+    return nullptr;
+  }
   obj1 = dict->lookup("BitsPerFlag");
   if (obj1.isInt()) {
     flagBits = obj1.getInt();
@@ -5146,7 +5180,7 @@
     for (i = 0; 5 + 2*i < obj1.arrayGetLength() && i < gfxColorMaxComps; ++i) {
       cMin[i] = (obj2 = obj1.arrayGet(4 + 2*i), obj2.getNum(&decodeOk));
       cMax[i] = (obj2 = obj1.arrayGet(5 + 2*i), obj2.getNum(&decodeOk));
-      cMul[i] = (cMax[i] - cMin[i]) / (double)((1 << compBits) - 1);
+      cMul[i] = (cMax[i] - cMin[i]) / (double)((1u << compBits) - 1);
     }
     nComps = i;
 
@@ -5283,6 +5317,7 @@
       case 1:
 	if (nPatchesA == 0) {
           gfree(patchesA);
+	  for (int k = 0; k < nFuncsA; ++k) delete funcsA[k];
 	  return nullptr;
 	}
 	p->x[0][0] = patchesA[nPatchesA-1].x[0][3];
@@ -5319,6 +5354,7 @@
       case 2:
 	if (nPatchesA == 0) {
           gfree(patchesA);
+	  for (int k = 0; k < nFuncsA; ++k) delete funcsA[k];
 	  return nullptr;
 	}
 	p->x[0][0] = patchesA[nPatchesA-1].x[3][3];
@@ -5355,6 +5391,7 @@
       case 3:
 	if (nPatchesA == 0) {
           gfree(patchesA);
+	  for (int k = 0; k < nFuncsA; ++k) delete funcsA[k];
 	  return nullptr;
 	}
 	p->x[0][0] = patchesA[nPatchesA-1].x[3][0];
@@ -5434,6 +5471,7 @@
       case 1:
 	if (nPatchesA == 0) {
           gfree(patchesA);
+	  for (int k = 0; k < nFuncsA; ++k) delete funcsA[k];
 	  return nullptr;
 	}
 	p->x[0][0] = patchesA[nPatchesA-1].x[0][3];
@@ -5478,6 +5516,7 @@
       case 2:
 	if (nPatchesA == 0) {
           gfree(patchesA);
+	  for (int k = 0; k < nFuncsA; ++k) delete funcsA[k];
 	  return nullptr;
 	}
 	p->x[0][0] = patchesA[nPatchesA-1].x[3][3];
@@ -5522,6 +5561,7 @@
       case 3:
 	if (nPatchesA == 0) {
           gfree(patchesA);
+	  for (int k = 0; k < nFuncsA; ++k) delete funcsA[k];
 	  return nullptr;
 	}
 	p->x[0][0] = patchesA[nPatchesA-1].x[3][0];
@@ -5651,7 +5691,7 @@
   Guchar *indexedLookup;
   Function *sepFunc;
   double x[gfxColorMaxComps];
-  double y[gfxColorMaxComps];
+  double y[gfxColorMaxComps] = {};
   int i, j, k;
   double mapped;
   GBool useByteLookup;
@@ -5677,6 +5717,9 @@
   }
   byte_lookup = nullptr;
 
+  if (unlikely(bits <= 0))
+    goto err1;
+
   // get decode map
   if (decode->isNull()) {
     nComps = colorSpace->getNComps();
@@ -6745,10 +6788,18 @@
 void GfxState::getUserClipBBox(double *xMin, double *yMin,
 			       double *xMax, double *yMax) {
   double ictm[6];
-  double xMin1, yMin1, xMax1, yMax1, det, tx, ty;
+  double xMin1, yMin1, xMax1, yMax1, tx, ty;
 
   // invert the CTM
-  det = 1 / (ctm[0] * ctm[3] - ctm[1] * ctm[2]);
+  const double det_denominator = (ctm[0] * ctm[3] - ctm[1] * ctm[2]);
+  if (unlikely(det_denominator == 0)) {
+      *xMin = 0;
+      *yMin = 0;
+      *xMax = 0;
+      *yMax = 0;
+      return;
+  }
+  const double det = 1 / det_denominator;
   ictm[0] = ctm[3] * det;
   ictm[1] = -ctm[1] * det;
   ictm[2] = -ctm[2] * det;

Modified: branches/stable/source/src/libs/poppler/poppler-src/poppler/GfxState.h
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/poppler/GfxState.h	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/poppler/GfxState.h	2018-07-10 17:26:48 UTC (rev 806)
@@ -915,7 +915,9 @@
   GBool getExtend1() { return extend1; }
   int getNFuncs() { return nFuncs; }
   Function *getFunc(int i) { return funcs[i]; }
-  void getColor(double t, GfxColor *color);
+  // returns the nComps of the shading
+  // i.e. how many positions of color have been set
+  int getColor(double t, GfxColor *color);
 
   void setupCache(const Matrix *ctm,
 		  double xMin, double yMin,

Modified: branches/stable/source/src/libs/poppler/poppler-src/poppler/GlobalParams.cc
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/poppler/GlobalParams.cc	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/poppler/GlobalParams.cc	2018-07-10 17:26:48 UTC (rev 806)
@@ -38,6 +38,7 @@
 // Copyright (C) 2017 Christoph Cullmann <cullmann at kde.org>
 // Copyright (C) 2017 Jean Ghali <jghali at libertysurf.fr>
 // Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info at kdab.com>. Work sponsored by the LiMux project of the city of Munich
+// Copyright (C) 2018 Adam Reichold <adam.reichold at t-online.de>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -66,7 +67,6 @@
 #include "goo/gmem.h"
 #include "goo/GooString.h"
 #include "goo/GooList.h"
-#include "goo/GooHash.h"
 #include "goo/gfile.h"
 #include "Error.h"
 #include "NameToCharCode.h"
@@ -549,9 +549,6 @@
 GlobalParams::GlobalParams(const char *customPopplerDataDir)
   : popplerDataDir(customPopplerDataDir)
 {
-  UnicodeMap *map;
-  int i;
-
 #ifdef MULTITHREADED
   gInitMutex(&mutex);
   gInitMutex(&unicodeMapCacheMutex);
@@ -563,24 +560,15 @@
   // scan the encoding in reverse because we want the lowest-numbered
   // index for each char name ('space' is encoded twice)
   macRomanReverseMap = new NameToCharCode();
-  for (i = 255; i >= 0; --i) {
+  for (int i = 255; i >= 0; --i) {
     if (macRomanEncoding[i]) {
       macRomanReverseMap->add(macRomanEncoding[i], (CharCode)i);
     }
   }
 
-#ifdef _WIN32
-  substFiles = new GooHash(gTrue);
-#endif
   nameToUnicodeZapfDingbats = new NameToCharCode();
   nameToUnicodeText = new NameToCharCode();
-  cidToUnicodes = new GooHash(gTrue);
-  unicodeToUnicodes = new GooHash(gTrue);
-  residentUnicodeMaps = new GooHash();
-  unicodeMaps = new GooHash(gTrue);
-  cMapDirs = new GooHash(gTrue);
   toUnicodeDirs = new GooList();
-  fontFiles = new GooHash(gTrue);
   sysFonts = new SysFontList();
   psExpandSmaller = gFalse;
   psShrinkLarger = gTrue;
@@ -613,31 +601,28 @@
 #endif
 
   // set up the initial nameToUnicode tables
-  for (i = 0; nameToUnicodeZapfDingbatsTab[i].name; ++i) {
+  for (int i = 0; nameToUnicodeZapfDingbatsTab[i].name; ++i) {
     nameToUnicodeZapfDingbats->add(nameToUnicodeZapfDingbatsTab[i].name, nameToUnicodeZapfDingbatsTab[i].u);
   }
 
-  for (i = 0; nameToUnicodeTextTab[i].name; ++i) {
+  for (int i = 0; nameToUnicodeTextTab[i].name; ++i) {
     nameToUnicodeText->add(nameToUnicodeTextTab[i].name, nameToUnicodeTextTab[i].u);
   }
 
   // set up the residentUnicodeMaps table
-  map = new UnicodeMap("Latin1", gFalse,
-		       latin1UnicodeMapRanges, latin1UnicodeMapLen);
-  residentUnicodeMaps->add(map->getEncodingName(), map);
-  map = new UnicodeMap("ASCII7", gFalse,
-		       ascii7UnicodeMapRanges, ascii7UnicodeMapLen);
-  residentUnicodeMaps->add(map->getEncodingName(), map);
-  map = new UnicodeMap("Symbol", gFalse,
-		       symbolUnicodeMapRanges, symbolUnicodeMapLen);
-  residentUnicodeMaps->add(map->getEncodingName(), map);
-  map = new UnicodeMap("ZapfDingbats", gFalse, zapfDingbatsUnicodeMapRanges,
-		       zapfDingbatsUnicodeMapLen);
-  residentUnicodeMaps->add(map->getEncodingName(), map);
-  map = new UnicodeMap("UTF-8", gTrue, &mapUTF8);
-  residentUnicodeMaps->add(map->getEncodingName(), map);
-  map = new UnicodeMap("UTF-16", gTrue, &mapUTF16);
-  residentUnicodeMaps->add(map->getEncodingName(), map);
+  residentUnicodeMaps.reserve(6);
+  UnicodeMap map = {"Latin1", gFalse, latin1UnicodeMapRanges, latin1UnicodeMapLen};
+  residentUnicodeMaps.emplace(map.getEncodingName()->toStr(), std::move(map));
+  map = {"ASCII7", gFalse, ascii7UnicodeMapRanges, ascii7UnicodeMapLen};
+  residentUnicodeMaps.emplace(map.getEncodingName()->toStr(), std::move(map));
+  map = {"Symbol", gFalse, symbolUnicodeMapRanges, symbolUnicodeMapLen};
+  residentUnicodeMaps.emplace(map.getEncodingName()->toStr(), std::move(map));
+  map = {"ZapfDingbats", gFalse, zapfDingbatsUnicodeMapRanges, zapfDingbatsUnicodeMapLen};
+  residentUnicodeMaps.emplace(map.getEncodingName()->toStr(), std::move(map));
+  map = {"UTF-8", gTrue, &mapUTF8};
+  residentUnicodeMaps.emplace(map.getEncodingName()->toStr(), std::move(map));
+  map = {"UTF-16", gTrue, &mapUTF16};
+  residentUnicodeMaps.emplace(map.getEncodingName()->toStr(), std::move(map));
 
   scanEncodingDirs();
 }
@@ -718,34 +703,16 @@
   fclose(f);
 }
 
-void GlobalParams::addCIDToUnicode(GooString *collection,
-				   GooString *fileName) {
-  GooString *old;
-
-  if ((old = (GooString *)cidToUnicodes->remove(collection))) {
-    delete old;
-  }
-  cidToUnicodes->add(collection->copy(), fileName->copy());
+void GlobalParams::addCIDToUnicode(GooString *collection, GooString *fileName) {
+  cidToUnicodes[collection->toStr()] = fileName->toStr();
 }
 
-void GlobalParams::addUnicodeMap(GooString *encodingName, GooString *fileName)
-{
-  GooString *old;
-
-  if ((old = (GooString *)unicodeMaps->remove(encodingName))) {
-    delete old;
-  }
-  unicodeMaps->add(encodingName->copy(), fileName->copy());
+void GlobalParams::addUnicodeMap(GooString *encodingName, GooString *fileName) {
+  unicodeMaps[encodingName->toStr()] = fileName->toStr();
 }
 
 void GlobalParams::addCMapDir(GooString *collection, GooString *dir) {
-  GooList *list;
-
-  if (!(list = (GooList *)cMapDirs->lookup(collection))) {
-    list = new GooList();
-    cMapDirs->add(collection->copy(), list);
-  }
-  list->append(dir->copy());
+  cMapDirs.emplace(collection->toStr(), dir->toStr());
 }
 
 GBool GlobalParams::parseYesNo2(const char *token, GBool *flag) {
@@ -766,28 +733,10 @@
 
   delete nameToUnicodeZapfDingbats;
   delete nameToUnicodeText;
-  deleteGooHash(cidToUnicodes, GooString);
-  deleteGooHash(unicodeToUnicodes, GooString);
-  deleteGooHash(residentUnicodeMaps, UnicodeMap);
-  deleteGooHash(unicodeMaps, GooString);
   deleteGooList(toUnicodeDirs, GooString);
-  deleteGooHash(fontFiles, GooString);
-#ifdef _WIN32
-  deleteGooHash(substFiles, GooString);
-#endif
   delete sysFonts;
   delete textEncoding;
 
-  GooHashIter *iter;
-  GooString *key;
-  cMapDirs->startIter(&iter);
-  void *val;
-  while (cMapDirs->getNext(&iter, &key, &val)) {
-    GooList* list = (GooList*)val;
-    deleteGooList(list, GooString);
-  }
-  delete cMapDirs;
-
   delete cidToUnicodeCache;
   delete unicodeToUnicodeCache;
   delete unicodeMapCache;
@@ -828,55 +777,48 @@
 }
 
 UnicodeMap *GlobalParams::getResidentUnicodeMap(GooString *encodingName) {
-  UnicodeMap *map;
+  UnicodeMap *map = nullptr;
 
   lockGlobalParams;
-  map = (UnicodeMap *)residentUnicodeMaps->lookup(encodingName);
-  unlockGlobalParams;
-  if (map) {
+  const auto unicodeMap = residentUnicodeMaps.find(encodingName->toStr());
+  if (unicodeMap != residentUnicodeMaps.end()) {
+    map = &unicodeMap->second;
     map->incRefCnt();
   }
+  unlockGlobalParams;
+
   return map;
 }
 
 FILE *GlobalParams::getUnicodeMapFile(GooString *encodingName) {
-  GooString *fileName;
-  FILE *f;
+  FILE *file = nullptr;
 
   lockGlobalParams;
-  if ((fileName = (GooString *)unicodeMaps->lookup(encodingName))) {
-    f = openFile(fileName->getCString(), "r");
-  } else {
-    f = nullptr;
+  const auto unicodeMap = unicodeMaps.find(encodingName->toStr());
+  if (unicodeMap != unicodeMaps.end()) {
+    file = openFile(unicodeMap->second.c_str(), "r");
   }
   unlockGlobalParams;
-  return f;
+
+  return file;
 }
 
 FILE *GlobalParams::findCMapFile(GooString *collection, GooString *cMapName) {
-  GooList *list;
-  GooString *dir;
-  GooString *fileName;
-  FILE *f;
-  int i;
+  FILE *file = nullptr;
 
   lockGlobalParams;
-  if (!(list = (GooList *)cMapDirs->lookup(collection))) {
-    unlockGlobalParams;
-    return nullptr;
-  }
-  for (i = 0; i < list->getLength(); ++i) {
-    dir = (GooString *)list->get(i);
-    fileName = appendToPath(dir->copy(), cMapName->getCString());
-    f = openFile(fileName->getCString(), "r");
-    delete fileName;
-    if (f) {
-      unlockGlobalParams;
-      return f;
+  const auto cMapDirs = this->cMapDirs.equal_range(collection->toStr());
+  for (auto cMapDir = cMapDirs.first; cMapDir != cMapDirs.second; ++cMapDir) {
+    auto* const path = new GooString(cMapDir->second);
+    appendToPath(path, cMapName->getCString());
+    file = openFile(path->getCString(), "r");
+    delete path;
+    if (file) {
+      break;
     }
   }
   unlockGlobalParams;
-  return nullptr;
+  return file;
 }
 
 FILE *GlobalParams::findToUnicodeFile(GooString *name) {
@@ -1074,17 +1016,16 @@
 #endif
 
 GooString *GlobalParams::findFontFile(GooString *fontName) {
-  GooString *path;
+  GooString *path = nullptr;
 
   setupBaseFonts(nullptr);
   lockGlobalParams;
-  if ((path = (GooString *)fontFiles->lookup(fontName))) {
-    path = path->copy();
-    unlockGlobalParams;
-    return path;
+  const auto fontFile = fontFiles.find(fontName->toStr());
+  if (fontFile != fontFiles.end()) {
+    path = new GooString(fontFile->second);
   }
   unlockGlobalParams;
-  return nullptr;
+  return path;
 }
 
 /* if you can't or don't want to use Fontconfig, you need to implement
@@ -1092,7 +1033,7 @@
 */
 #ifdef WITH_FONTCONFIGURATION_FONTCONFIG
 // not needed for fontconfig
-void GlobalParams::setupBaseFonts(char *dir) {
+void GlobalParams::setupBaseFonts(char *) {
 }
 
 GooString *GlobalParams::findBase14FontFile(GooString *base14Name, GfxFont *font) {
@@ -1313,7 +1254,7 @@
   int i, j;
 
   for (i = 0; displayFontTab[i].name; ++i) {
-    if (fontFiles->lookup(displayFontTab[i].name)) {
+    if (fontFiles.count(displayFontTab[i].name) > 0) {
       continue;
     }
     fontName = new GooString(displayFontTab[i].name);
@@ -1355,9 +1296,12 @@
   SysFontInfo *fi;
   GooString *path;
 
+  const GooString *fontName = font->getName();
+  if (!fontName) return nullptr;
+
   path = NULL;
   lockGlobalParams;
-  if ((fi = sysFonts->find(font->getName(), font->isFixedWidth(), gFalse))) {
+  if ((fi = sysFonts->find(fontName, font->isFixedWidth(), gFalse))) {
     path = fi->path->copy();
     *type = fi->type;
     *fontNum = fi->fontNum;
@@ -1455,14 +1399,15 @@
 }
 
 CharCodeToUnicode *GlobalParams::getCIDToUnicode(GooString *collection) {
-  GooString *fileName;
   CharCodeToUnicode *ctu;
 
   lockGlobalParams;
   if (!(ctu = cidToUnicodeCache->getCharCodeToUnicode(collection))) {
-    if ((fileName = (GooString *)cidToUnicodes->lookup(collection)) &&
-	(ctu = CharCodeToUnicode::parseCIDToUnicode(fileName, collection))) {
-      cidToUnicodeCache->add(ctu);
+    const auto cidToUnicode = cidToUnicodes.find(collection->toStr());
+    if (cidToUnicode != cidToUnicodes.end()) {
+      if((ctu = CharCodeToUnicode::parseCIDToUnicode(cidToUnicode->second.c_str(), collection))) {
+        cidToUnicodeCache->add(ctu);
+      }
     }
   }
   unlockGlobalParams;
@@ -1469,32 +1414,6 @@
   return ctu;
 }
 
-CharCodeToUnicode *GlobalParams::getUnicodeToUnicode(GooString *fontName) {
-  lockGlobalParams;
-  GooHashIter *iter;
-  unicodeToUnicodes->startIter(&iter);
-  GooString *fileName = nullptr;
-  GooString *fontPattern;
-  void *val;
-  while (!fileName && unicodeToUnicodes->getNext(&iter, &fontPattern, &val)) {
-    if (strstr(fontName->getCString(), fontPattern->getCString())) {
-      unicodeToUnicodes->killIter(&iter);
-      fileName = (GooString*)val;
-    }
-  }
-  CharCodeToUnicode *ctu = nullptr;
-  if (fileName) {
-    ctu = unicodeToUnicodeCache->getCharCodeToUnicode(fileName);
-    if (!ctu) {
-      ctu = CharCodeToUnicode::parseUnicodeToUnicode(fileName);
-      if (ctu)
-         unicodeToUnicodeCache->add(ctu);
-    }
-  }
-  unlockGlobalParams;
-  return ctu;
-}
-
 UnicodeMap *GlobalParams::getUnicodeMap(GooString *encodingName) {
   return getUnicodeMap2(encodingName);
 }
@@ -1525,20 +1444,13 @@
 
 GooList *GlobalParams::getEncodingNames()
 {
-  GooList *result = new GooList;
-  GooHashIter *iter;
-  GooString *key;
-  void *val;
-  residentUnicodeMaps->startIter(&iter);
-  while (residentUnicodeMaps->getNext(&iter, &key, &val)) {
-    result->append(key);
+  auto* const result = new GooList;
+  for (const auto& unicodeMap : residentUnicodeMaps) {
+    result->append(new GooString(unicodeMap.first));
   }
-  residentUnicodeMaps->killIter(&iter);
-  unicodeMaps->startIter(&iter);
-  while (unicodeMaps->getNext(&iter, &key, &val)) {
-    result->append(key);
+  for (const auto& unicodeMap : unicodeMaps) {
+    result->append(new GooString(unicodeMap.first));
   }
-  unicodeMaps->killIter(&iter);
   return result;
 }
 
@@ -1548,7 +1460,7 @@
 
 void GlobalParams::addFontFile(GooString *fontName, GooString *path) {
   lockGlobalParams;
-  fontFiles->add(fontName, path);
+  fontFiles[fontName->toStr()] = path->toStr();
   unlockGlobalParams;
 }
 

Modified: branches/stable/source/src/libs/poppler/poppler-src/poppler/GlobalParams.h
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/poppler/GlobalParams.h	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/poppler/GlobalParams.h	2018-07-10 17:26:48 UTC (rev 806)
@@ -26,6 +26,7 @@
 // Copyright (C) 2012, 2017 Adrian Johnson <ajohnson at redneon.com>
 // Copyright (C) 2012 Thomas Freitag <Thomas.Freitag at alfa.de>
 // Copyright (C) 2013 Jason Crain <jason at aquaticape.us>
+// Copyright (C) 2018 Adam Reichold <adam.reichold at t-online.de>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -44,6 +45,9 @@
 #include <stdio.h>
 #include "goo/gtypes.h"
 #include "CharTypes.h"
+#include "UnicodeMap.h"
+#include <unordered_map>
+#include <string>
 
 #ifdef MULTITHREADED
 #include "goo/GooMutex.h"
@@ -51,11 +55,9 @@
 
 class GooString;
 class GooList;
-class GooHash;
 class NameToCharCode;
 class CharCodeToUnicode;
 class CharCodeToUnicodeCache;
-class UnicodeMap;
 class UnicodeMapCache;
 class CMap;
 class CMapCache;
@@ -147,7 +149,6 @@
   GBool getErrQuiet();
 
   CharCodeToUnicode *getCIDToUnicode(GooString *collection);
-  CharCodeToUnicode *getUnicodeToUnicode(GooString *fontName);
   UnicodeMap *getUnicodeMap(GooString *encodingName);
   CMap *getCMap(GooString *collection, GooString *cMapName, Stream *stream = NULL);
   UnicodeMap *getTextEncoding();
@@ -199,24 +200,25 @@
     nameToUnicodeZapfDingbats;
   NameToCharCode *		// mapping from char name to Unicode for text
     nameToUnicodeText;		// extraction
-  GooHash *cidToUnicodes;		// files for mappings from char collections
-				//   to Unicode, indexed by collection name
-				//   [GooString]
-  GooHash *unicodeToUnicodes;	// files for Unicode-to-Unicode mappings,
-				//   indexed by font name pattern [GooString]
-  GooHash *residentUnicodeMaps;	// mappings from Unicode to char codes,
-				//   indexed by encoding name [UnicodeMap]
-  GooHash *unicodeMaps;		// files for mappings from Unicode to char
-				//   codes, indexed by encoding name [GooString]
-  GooHash *cMapDirs;		// list of CMap dirs, indexed by collection
-				//   name [GooList[GooString]]
+  // files for mappings from char collections
+  // to Unicode, indexed by collection name
+  std::unordered_map<std::string, std::string> cidToUnicodes;
+  // mappings from Unicode to char codes,
+  // indexed by encoding name
+  std::unordered_map<std::string, UnicodeMap> residentUnicodeMaps;
+  // files for mappings from Unicode to char
+  // codes, indexed by encoding name
+  std::unordered_map<std::string, std::string> unicodeMaps;
+  // list of CMap dirs, indexed by collection
+  std::unordered_multimap<std::string, std::string> cMapDirs;
   GooList *toUnicodeDirs;		// list of ToUnicode CMap dirs [GooString]
   GBool baseFontsInitialized;
 #ifdef _WIN32
-  GooHash *substFiles;	// windows font substitutes (for CID fonts)
+  // windows font substitutes (for CID fonts)
+  std::unordered_map<std::string, std::string> substFiles;
 #endif
-  GooHash *fontFiles;		// font files: font name mapped to path
-				//   [GString]
+  // font files: font name mapped to path
+  std::unordered_map<std::string, std::string> fontFiles;
   SysFontList *sysFonts;	// system fonts
   GBool psExpandSmaller;	// expand smaller pages to fill paper
   GBool psShrinkLarger;		// shrink larger pages to fit paper

Modified: branches/stable/source/src/libs/poppler/poppler-src/poppler/GlobalParamsWin.cc
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/poppler/GlobalParamsWin.cc	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/poppler/GlobalParamsWin.cc	2018-07-10 17:26:48 UTC (rev 806)
@@ -6,7 +6,7 @@
    // Copyright (C) 2012 Suzuki Toshiya <mpsuzuki at hiroshima-u.ac.jp>
    // Copyright (C) 2012, 2017 Adrian Johnson <ajohnson at redneon.com>
    // Copyright (C) 2012 Mark Brand <mabrand at mabrand.nl>
-   // Copyright (C) 2013 Adam Reichold <adamreichold at myopera.com>
+   // Copyright (C) 2013, 2018 Adam Reichold <adamreichold at myopera.com>
    // Copyright (C) 2013 Dmytro Morgun <lztoad at gmail.com>
    // Copyright (C) 2017 Christoph Cullmann <cullmann at kde.org>
    // Copyright (C) 2017, 2018 Albert Astals Cid <aacid at kde.org>
@@ -38,7 +38,6 @@
 #include "goo/gmem.h"
 #include "goo/GooString.h"
 #include "goo/GooList.h"
-#include "goo/GooHash.h"
 #include "goo/gfile.h"
 #include "Error.h"
 #include "NameToCharCode.h"
@@ -423,10 +422,11 @@
     GetWindowsFontDir(winFontDir, sizeof(winFontDir));
 
     for (int i = 0; displayFontTab[i].name; ++i) {
-        GooString  *fontName = new GooString(displayFontTab[i].name);
-        if (fontFiles->lookup(fontName))
+        if (fontFiles.count(displayFontTab[i].name) > 0)
             continue;
 
+        GooString  *fontName = new GooString(displayFontTab[i].name);
+
         if (dir) {
             GooString *fontPath = appendToPath(new GooString(dir), displayFontTab[i].t1FileName);
             if (FileExists(fontPath->getCString()) ||
@@ -480,7 +480,7 @@
 	          addFontFile(new GooString(obj1.getName()), obj3.getString()->copy());
 	      // Aliases
 	      } else if (obj2.isName()) {
-	        substFiles->add(new GooString(obj1.getName()), new GooString(obj2.getName()));
+                substFiles.emplace(obj1.getName(), obj2.getName());
 	      }
 	    }
 	    obj1 = parser->getObj();
@@ -497,8 +497,8 @@
     }
 }
 
-static const char *findSubstituteName(GfxFont *font, GooHash *fontFiles,
-                                      GooHash *substFiles,
+static const char *findSubstituteName(GfxFont *font, const std::unordered_map<std::string, std::string>& fontFiles,
+                                      const std::unordered_map<std::string, std::string>& substFiles,
                                       const char *origName)
 {
     assert(origName);
@@ -515,10 +515,10 @@
       name2->del(n - 11, 11);
       n -= 11;
     }
-    GooString *substName = (GooString *)substFiles->lookup(name2);
-    if (substName != nullptr) {
+    const auto substFile = substFiles.find(name2->getCString());
+    if (substFile != substFiles.end()) {
       delete name2;
-      return substName->getCString();
+      return substFile->second.c_str();
     }
 
     /* TODO: try to at least guess bold/italic/bolditalic from the name */
@@ -538,10 +538,10 @@
       else if ( !collection->cmp("Adobe-Korea1") )
         name3 = DEFAULT_CID_FONT_AK1_MSWIN;
 
-      if (name3 && fontFiles->lookup(name3))
+      if (name3 && fontFiles.count(name3) != 0)
         return name3;
 
-      if (fontFiles->lookup(DEFAULT_CID_FONT_MSWIN))
+      if (fontFiles.count(DEFAULT_CID_FONT_MSWIN) != 0)
         return DEFAULT_CID_FONT_MSWIN;
     } 
     return DEFAULT_SUBSTITUTE_FONT;
@@ -573,10 +573,10 @@
     GooString *substFontName = new GooString(findSubstituteName(font, fontFiles,
                                                                 substFiles,
                                                                 fontName->getCString()));
-    GooString *path2 = nullptr;
     error(errSyntaxError, -1, "Couldn't find a font for '{0:t}', subst is '{1:t}'", fontName, substFontName);
-    if ((path2 = (GooString *)fontFiles->lookup(substFontName))) {
-      path = new GooString(path2);
+    const auto fontFile = fontFiles.find(substFontName->toStr());
+    if (fontFile != fontFiles.end()) {
+      path = new GooString(fontFile->second.c_str());
       if (substituteFontName)
 	substituteFontName->Set(path->getCString());
       if (!strcasecmp(path->getCString() + path->getLength() - 4, ".ttc")) {

Modified: branches/stable/source/src/libs/poppler/poppler-src/poppler/Hints.cc
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/poppler/Hints.cc	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/poppler/Hints.cc	2018-07-10 17:26:48 UTC (rev 806)
@@ -5,7 +5,7 @@
 // This file is licensed under the GPLv2 or later
 //
 // Copyright 2010, 2012 Hib Eris <hib at hiberis.nl>
-// Copyright 2010, 2011, 2013, 2014, 2016, 2017 Albert Astals Cid <aacid at kde.org>
+// Copyright 2010, 2011, 2013, 2014, 2016-2018 Albert Astals Cid <aacid at kde.org>
 // Copyright 2010, 2013 Pino Toscano <pino at kde.org>
 // Copyright 2013 Adrian Johnson <ajohnson at redneon.com>
 // Copyright 2014 Fabio D'Urso <fabiodurso at hotmail.it>
@@ -258,6 +258,11 @@
   if (objectOffsetFirst >= hintsOffset) objectOffsetFirst += hintsLength;
 
   nBitsDiffObjects = sbr.readBits(16);
+  if (nBitsDiffObjects > 32) {
+    error(errSyntaxWarning, -1, "Invalid number of bits needed to represent the difference between the greatest and least number of objects in a page");
+    nPages = 0;
+    return gFalse;
+  }
 
   pageLengthLeast = sbr.readBits(32);
 

Modified: branches/stable/source/src/libs/poppler/poppler-src/poppler/JBIG2Stream.cc
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/poppler/JBIG2Stream.cc	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/poppler/JBIG2Stream.cc	2018-07-10 17:26:48 UTC (rev 806)
@@ -1562,7 +1562,7 @@
   JBIG2Bitmap *collBitmap, *refBitmap;
   Guint *symWidths;
   Guint symHeight, symWidth, totalWidth, x, symID;
-  int dh, dw, refAggNum, refDX, refDY, bmSize;
+  int dh = 0, dw, refAggNum, refDX = 0, refDY = 0, bmSize;
   GBool ex;
   int run, cnt, c;
   Guint i, j, k;
@@ -1896,6 +1896,7 @@
 	}
 	for (k = 0; k < (Guint)bmSize; ++k) {
 	  if ((c = curStr->getChar()) == EOF) {
+	    memset(p, 0, bmSize - k);
 	    break;
 	  }
 	  *p++ = (Guchar)c;
@@ -1930,6 +1931,8 @@
   // exported symbol list
   i = j = 0;
   ex = gFalse;
+  run = 0; // initialize it once in case the first decodeInt fails
+           // we do not want to use uninitialized memory
   while (i < numInputSyms + numNewSyms) {
     if (huff) {
       huffDecoder->decodeInt(&run, huffTableA);
@@ -2335,8 +2338,8 @@
   JBIG2Bitmap *bitmap;
   JBIG2Bitmap *symbolBitmap;
   Guint strips;
-  int t, dt, tt, s, ds, sFirst, j;
-  int rdw, rdh, rdx, rdy, ri, refDX, refDY, bmSize;
+  int t = 0, dt = 0, tt, s, ds = 0, sFirst, j;
+  int rdw, rdh, rdx, rdy, ri = 0, refDX, refDY, bmSize;
   Guint symID, inst, bw, bh;
 
   strips = 1 << logStrips;
@@ -4023,6 +4026,7 @@
   } else {
     curPageH = pageH;
   }
+  delete pageBitmap;
   pageBitmap = new JBIG2Bitmap(0, pageW, curPageH);
 
   if (!pageBitmap->isOk()) {

Modified: branches/stable/source/src/libs/poppler/poppler-src/poppler/Lexer.cc
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/poppler/Lexer.cc	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/poppler/Lexer.cc	2018-07-10 17:26:48 UTC (rev 806)
@@ -206,7 +206,7 @@
 	  xf = xf * 10.0 + (c - '0');
 	} else if (unlikely (overflownInteger)) {
 	  if (unlikely(xll > LongLongSafeLimit) &&
-	      (xll > (LLONG_MAX - (c - '0')) / 10.0)) {
+	      (xll > (LLONG_MAX - (c - '0')) / 10)) {
 	    overflownLongLong = gTrue;
 	    xf = xll * 10.0 + (c - '0');
 	  } else {

Modified: branches/stable/source/src/libs/poppler/poppler-src/poppler/OutputDev.cc
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/poppler/OutputDev.cc	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/poppler/OutputDev.cc	2018-07-10 17:26:48 UTC (rev 806)
@@ -19,6 +19,7 @@
 // Copyright (C) 2009 Carlos Garcia Campos <carlosgc at gnome.org>
 // Copyright (C) 2009, 2012, 2013 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2012 Thomas Freitag <Thomas.Freitag at alfa.de>
+// Copyright (C) 2018 Adam Reichold <adam.reichold at t-online.de>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -36,7 +37,6 @@
 #include "Stream.h"
 #include "GfxState.h"
 #include "OutputDev.h"
-#include "goo/GooHash.h"
 
 //------------------------------------------------------------------------
 // OutputDev
@@ -179,18 +179,11 @@
 #endif
 
 void OutputDev::startProfile() {
-  if (profileHash)
-    delete profileHash;
-
-  profileHash = new GooHash (true);
+  profileHash.reset(new std::unordered_map<std::string, ProfileData>);
 }
 
-GooHash *OutputDev::endProfile() {
-  GooHash *profile = profileHash;
-
-  profileHash = nullptr;
-
-  return profile;
+std::unique_ptr<std::unordered_map<std::string, ProfileData>> OutputDev::endProfile() {
+  return std::move(profileHash);
 }
 
 #ifdef USE_CMS

Modified: branches/stable/source/src/libs/poppler/poppler-src/poppler/OutputDev.h
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/poppler/OutputDev.h	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/poppler/OutputDev.h	2018-07-10 17:26:48 UTC (rev 806)
@@ -25,6 +25,7 @@
 // Copyright (C) 2012 William Bader <williambader at hotmail.com>
 // Copyright (C) 2017, 2018 Oliver Sander <oliver.sander at tu-dresden.de>
 // Copyright (C) 2018 Klar\xE4lvdalens Datakonsult AB, a KDAB Group company, <info at kdab.com>. Work sponsored by the LiMux project of the city of Munich
+// Copyright (C) 2018 Adam Reichold <adam.reichold at t-online.de>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -43,10 +44,13 @@
 #include "CharTypes.h"
 #include "Object.h"
 #include "PopplerCache.h"
+#include "ProfileData.h"
+#include <memory>
+#include <unordered_map>
+#include <string>
 
 class Annot;
 class Dict;
-class GooHash;
 class GooString;
 class GfxState;
 class Gfx;
@@ -80,7 +84,6 @@
  : iccColorSpaceCache(5)
 #endif
   {
-      profileHash = nullptr;
   }
 
   // Destructor.
@@ -333,9 +336,9 @@
   virtual void psXObject(Stream * /*psStream*/, Stream * /*level1Stream*/) {}
 
   //----- Profiling
-  virtual void startProfile();
-  virtual GooHash *getProfileHash() {return profileHash; }
-  virtual GooHash *endProfile();
+  void startProfile();
+  std::unordered_map<std::string, ProfileData>* getProfileHash() const { return profileHash.get(); }
+  std::unique_ptr<std::unordered_map<std::string, ProfileData>> endProfile();
 
   //----- transparency groups and soft masks
   virtual GBool checkTransparencyGroup(GfxState * /*state*/, GBool /*knockout*/) { return gTrue; }
@@ -365,7 +368,7 @@
 
   double defCTM[6];		// default coordinate transform matrix
   double defICTM[6];		// inverse of default CTM
-  GooHash *profileHash;
+  std::unique_ptr<std::unordered_map<std::string, ProfileData>> profileHash;
 
 #ifdef USE_CMS
   PopplerCache iccColorSpaceCache;

Modified: branches/stable/source/src/libs/poppler/poppler-src/poppler/PSOutputDev.cc
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/poppler/PSOutputDev.cc	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/poppler/PSOutputDev.cc	2018-07-10 17:26:48 UTC (rev 806)
@@ -32,6 +32,7 @@
 // Copyright (C) 2015 Marek Kasik <mkasik at redhat.com>
 // Copyright (C) 2016 Caolán McNamara <caolanm at redhat.com>
 // Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info at kdab.com>. Work sponsored by the LiMux project of the city of Munich
+// Copyright (C) 2018 Adam Reichold <adam.reichold at t-online.de>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -53,7 +54,6 @@
 #include <algorithm>
 #include "goo/GooString.h"
 #include "goo/GooList.h"
-#include "goo/GooHash.h"
 #include "poppler-config.h"
 #include "GlobalParams.h"
 #include "Object.h"
@@ -1108,8 +1108,6 @@
   customCodeCbkData = customCodeCbkDataA;
 
   fontIDs = nullptr;
-  fontNames = new GooHash(gTrue);
-  fontMaxValidGlyph = new GooHash(gTrue);
   t1FontNames = nullptr;
   font8Info = nullptr;
   font16Enc = nullptr;
@@ -1177,8 +1175,6 @@
   customCodeCbkData = customCodeCbkDataA;
 
   fontIDs = nullptr;
-  fontNames = new GooHash(gTrue);
-  fontMaxValidGlyph = new GooHash(gTrue);
   t1FontNames = nullptr;
   font8Info = nullptr;
   font16Enc = nullptr;
@@ -1409,7 +1405,7 @@
   fontIDLen = 0;
   fontIDs = (Ref *)gmallocn(fontIDSize, sizeof(Ref));
   for (i = 0; i < 14; ++i) {
-    fontNames->add(new GooString(psBase14SubstFonts[i].psName), 1);
+    fontNames.emplace(psBase14SubstFonts[i].psName);
   }
   t1FontNameSize = 64;
   t1FontNameLen = 0;
@@ -1499,8 +1495,6 @@
   if (fontIDs) {
     gfree(fontIDs);
   }
-  delete fontNames;
-  delete fontMaxValidGlyph;
   if (t1FontNames) {
     for (i = 0; i < t1FontNameLen; ++i) {
       delete t1FontNames[i].psName;
@@ -2128,10 +2122,9 @@
   GBool writePadding = gTrue;
 
   // check if font is already embedded
-  if (fontNames->lookupInt(psName)) {
+  if (!fontNames.emplace(psName->toStr()).second) {
     return;
   }
-  fontNames->add(psName->copy(), 1);
 
   // get the font stream and info
   Object obj1, obj2, obj3;
@@ -2307,10 +2300,9 @@
   FILE *fontFile;
   int c;
 
-  if (fontNames->lookupInt(psName)) {
+  if (!fontNames.emplace(psName->toStr()).second) {
     return;
   }
-  fontNames->add(psName->copy(), 1);
 
   // beginning comment
   writePSFmt("%%BeginResource: font {0:t}\n", psName);
@@ -2546,8 +2538,9 @@
 
 void PSOutputDev::updateFontMaxValidGlyph(GfxFont *font, int maxValidGlyph) {
   if (maxValidGlyph >= 0 && font->getName()) {
-    if (maxValidGlyph > fontMaxValidGlyph->lookupInt(font->getName())) {
-      fontMaxValidGlyph->replace(font->getName()->copy(), maxValidGlyph);
+    auto& fontMaxValidGlyph = this->fontMaxValidGlyph[font->getName()->toStr()];
+    if (fontMaxValidGlyph < maxValidGlyph) {
+      fontMaxValidGlyph = maxValidGlyph;
     }
   }
 }
@@ -2872,8 +2865,7 @@
 
   if ((s = font->getEmbeddedFontName())) {
     psName = filterPSName(s);
-    if (!fontNames->lookupInt(psName)) {
-      fontNames->add(psName->copy(), 1);
+    if (fontNames.emplace(psName->toStr()).second) {
       return psName;
     }
     delete psName;
@@ -2880,8 +2872,7 @@
   }
   if ((s = font->getName())) {
     psName = filterPSName(s);
-    if (!fontNames->lookupInt(psName)) {
-      fontNames->add(psName->copy(), 1);
+    if (fontNames.emplace(psName->toStr()).second) {
       return psName;
     }
     delete psName;
@@ -2896,7 +2887,7 @@
     psName->append('_')->append(s);
     delete s;
   }
-  fontNames->add(psName->copy(), 1);
+  fontNames.emplace(psName->toStr());
   return psName;
 }
 
@@ -5042,7 +5033,7 @@
   if (!(font = state->getFont())) {
     return;
   }
-  maxGlyphInt = (font->getName()? fontMaxValidGlyph->lookupInt(font->getName()): 0);
+  maxGlyphInt = (font->getName() ? fontMaxValidGlyph[font->getName()->toStr()] : 0);
   if (maxGlyphInt < 0) maxGlyphInt = 0;
   maxGlyph = (CharCode) maxGlyphInt;
   wMode = font->getWMode();

Modified: branches/stable/source/src/libs/poppler/poppler-src/poppler/PSOutputDev.h
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/poppler/PSOutputDev.h	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/poppler/PSOutputDev.h	2018-07-10 17:26:48 UTC (rev 806)
@@ -25,6 +25,7 @@
 // Copyright (C) 2011, 2014, 2017 Adrian Johnson <ajohnson at redneon.com>
 // Copyright (C) 2012 Fabio D'Urso <fabiodurso at hotmail.it>
 // Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info at kdab.com>. Work sponsored by the LiMux project of the city of Munich
+// Copyright (C) 2018 Adam Reichold <adam.reichold at t-online.de>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -47,8 +48,10 @@
 #include <set>
 #include <map>
 #include <vector>
+#include <unordered_set>
+#include <unordered_map>
+#include <string>
 
-class GHooash;
 class PDFDoc;
 class XRef;
 class Function;
@@ -475,8 +478,8 @@
   int fontIDLen;		// number of entries in fontIDs array
   int fontIDSize;		// size of fontIDs array
   std::set<int> resourceIDs;	// list of object IDs of objects containing Resources we've already set up
-  GooHash *fontNames;		// all used font names
-  GooHash *fontMaxValidGlyph;	// max valid glyph of each font
+  std::unordered_set<std::string> fontNames; // all used font names
+  std::unordered_map<std::string, int> fontMaxValidGlyph; // max valid glyph of each font
   PST1FontName *t1FontNames;	// font names for Type 1/1C fonts
   int t1FontNameLen;		// number of entries in t1FontNames array
   int t1FontNameSize;		// size of t1FontNames array

Modified: branches/stable/source/src/libs/poppler/poppler-src/poppler/Parser.cc
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/poppler/Parser.cc	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/poppler/Parser.cc	2018-07-10 17:26:48 UTC (rev 806)
@@ -13,7 +13,7 @@
 // All changes made under the Poppler project to this file are licensed
 // under GPL version 2 or later
 //
-// Copyright (C) 2006, 2009, 201, 2010, 2013, 2014, 2017 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2006, 2009, 201, 2010, 2013, 2014, 2017, 2018 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2006 Krzysztof Kowalczyk <kkowalczyk at gmail.com>
 // Copyright (C) 2009 Ilya Gorenbein <igorenbein at finjan.com>
 // Copyright (C) 2012 Hib Eris <hib at hiberis.nl>
@@ -235,6 +235,12 @@
       pos = pos - 1;
       lexer->lookCharLastValueCached = Lexer::LOOK_VALUE_NOT_CACHED;
   }
+  if (unlikely(length < 0)) {
+      return nullptr;
+  }
+  if (unlikely(pos > LLONG_MAX - length)) {
+      return nullptr;
+  }
   lexer->setPos(pos + length);
 
   // refill token buffers and check for 'endstream'
@@ -255,7 +261,8 @@
       // When building the xref we can't use it so use this
       // kludge for broken PDF files: just add 5k to the length, and
       // hope its enough
-      length += 5000;
+      if (length < LLONG_MAX - 5000)
+        length += 5000;
     }
   }
 

Modified: branches/stable/source/src/libs/poppler/poppler-src/poppler/ProfileData.cc
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/poppler/ProfileData.cc	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/poppler/ProfileData.cc	2018-07-10 17:26:48 UTC (rev 806)
@@ -3,6 +3,7 @@
 // ProfileData.cc
 //
 // Copyright 2005 Jonathan Blandford <jrb at gnome.org>
+// Copyright 2018 Adam Reichold <adam.reichold at t-online.de>
 //
 //========================================================================
 
@@ -12,8 +13,6 @@
 #pragma implementation
 #endif
 
-#include <stdlib.h>
-#include <stddef.h>
 #include "ProfileData.h"
 
 //------------------------------------------------------------------------
@@ -20,13 +19,6 @@
 // ProfileData
 //------------------------------------------------------------------------
 
-ProfileData::ProfileData() {
-	count = 0;
-	total = 0.0;
-	min = 0.0;
-	max = 0.0;
-}
-
 void
 ProfileData::addElement (double elapsed) {
 	if (count == 0) {

Modified: branches/stable/source/src/libs/poppler/poppler-src/poppler/ProfileData.h
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/poppler/ProfileData.h	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/poppler/ProfileData.h	2018-07-10 17:26:48 UTC (rev 806)
@@ -3,6 +3,7 @@
 // ProfileData.h
 //
 // Copyright 2005 Jonathan Blandford <jrb at gnome.org>
+// Copyright 2018 Adam Reichold <adam.reichold at t-online.de>
 //
 //========================================================================
 
@@ -19,23 +20,17 @@
 
 class ProfileData {
 public:
+  void addElement (double elapsed);
 
-  // Constructor.
-  ProfileData ();
-
-  // Destructor.
-  ~ProfileData() {}
-
-  void addElement (double elapsed);
-  int getCount () { return count; }
-  double getTotal () { return total; }
-  double getMin () { return max; }
-  double getMax () { return max; }
+  int getCount () const { return count; }
+  double getTotal () const { return total; }
+  double getMin () const { return max; }
+  double getMax () const { return max; }
 private:
-  int count;			// size of <elems> array
-  double total;			// number of elements in array
-  double min;			// reference count
-  double max;			// reference count
+  int count = 0;      // size of <elems> array
+  double total = 0.0; // number of elements in array
+  double min = 0.0;   // reference count
+  double max = 0.0;   // reference count
 };
 
 #endif

Modified: branches/stable/source/src/libs/poppler/poppler-src/poppler/SecurityHandler.cc
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/poppler/SecurityHandler.cc	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/poppler/SecurityHandler.cc	2018-07-10 17:26:48 UTC (rev 806)
@@ -315,6 +315,9 @@
 }
 
 GBool StandardSecurityHandler::isUnencrypted() {
+  if (!ok) {
+    return gTrue;
+  }
   return encVersion == -1 && encRevision == -1;
 }
 

Modified: branches/stable/source/src/libs/poppler/poppler-src/poppler/SplashOutputDev.cc
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/poppler/SplashOutputDev.cc	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/poppler/SplashOutputDev.cc	2018-07-10 17:26:48 UTC (rev 806)
@@ -39,6 +39,7 @@
 // Copyright (C) 2016 Takahiro Hashimoto <kenya888.en at gmail.com>
 // Copyright (C) 2017 Even Rouault <even.rouault at spatialys.com>
 // Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info at kdab.com>. Work sponsored by the LiMux project of the city of Munich
+// Copyright (C) 2018 Stefan Brüns <stefan.bruens at rwth-aachen.de>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -315,7 +316,11 @@
   if (! getParameter (xc, yc, &t))
       return gFalse;
 
-  shading->getColor(t, &gfxColor);
+  const int filled = shading->getColor(t, &gfxColor);
+  if (unlikely(filled < shading->getColorSpace()->getNComps())) {
+    for (int i = filled; i < shading->getColorSpace()->getNComps(); ++i)
+      gfxColor.c[i] = 0;
+  }
   convertGfxColor(c, colorMode, shading->getColorSpace(), &gfxColor);
   return gTrue;
 }
@@ -453,7 +458,12 @@
   shadingA->getCoords(&x0, &y0, &x1, &y1);
   dx = x1 - x0;
   dy = y1 - y0;
-  mul = 1 / (dx * dx + dy * dy);
+  const double mul_denominator = (dx * dx + dy * dy);
+  if (unlikely(mul_denominator == 0)) {
+    mul = 0;
+  } else {
+    mul = 1 / mul_denominator;
+  }
   shadingA->getColorSpace()->getDefaultColor(&srcColor);
   convertGfxColor(defaultColor, colorModeA, shadingA->getColorSpace(), &srcColor);
 }
@@ -1251,7 +1261,6 @@
 			 double m21A, double m22A,
 			 int glyphXA, int glyphYA, int glyphWA, int glyphHA,
 			 GBool validBBoxA, GBool aa) {
-  int i;
 
   fontID = *fontIDA;
   m11 = m11A;
@@ -1265,8 +1274,7 @@
   validBBox = validBBoxA;
   // sanity check for excessively large glyphs (which most likely
   // indicate an incorrect BBox)
-  i = glyphW * glyphH;
-  if (i > 100000 || glyphW > INT_MAX / glyphH || glyphW <= 0 || glyphH <= 0) {
+  if (glyphW > INT_MAX / glyphH || glyphW <= 0 || glyphH <= 0 || glyphW * glyphH > 100000) {
     glyphW = glyphH = 100;
     validBBox = gFalse;
   }
@@ -1293,7 +1301,7 @@
   {
     cacheTags = (T3FontCacheTag *)gmallocn(cacheSets * cacheAssoc,
 					 sizeof(T3FontCacheTag));
-    for (i = 0; i < cacheSets * cacheAssoc; ++i) {
+    for (int i = 0; i < cacheSets * cacheAssoc; ++i) {
       cacheTags[i].mru = i & (cacheAssoc - 1);
     }
   }
@@ -1445,6 +1453,7 @@
   if (bitmap) {
     delete bitmap;
   }
+  delete textClipPath;
 }
 
 void SplashOutputDev::startDoc(PDFDoc *docA) {
@@ -2360,6 +2369,7 @@
   for (i = 0; i < path->getNumSubpaths(); ++i) {
     subpath = path->getSubpath(i);
     if (subpath->getNumPoints() > n) {
+      sPath->reserve(subpath->getNumPoints() + 1);
       sPath->moveTo((SplashCoord)subpath->getX(0),
 		    (SplashCoord)subpath->getY(0));
       j = 1;
@@ -2512,6 +2522,13 @@
   double x1, y1, xMin, yMin, xMax, yMax, xt, yt;
   int i, j;
 
+  // check for invisible text -- this is used by Acrobat Capture
+  if (state->getRender() == 3) {
+    // this is a bit of cheating, we say yes, font is already on cache
+    // so we actually skip the rendering of it
+    return gTrue;
+  }
+
   if (skipHorizText || skipRotatedText) {
     state->getFontTransMat(&m[0], &m[1], &m[2], &m[3]);
     horiz = m[0] > 0 && fabs(m[1]) < 0.001 &&
@@ -3975,11 +3992,15 @@
   //----- set up the soft mask
 
   if (maskColorMap->getMatteColor() != nullptr) {
-    Guchar *data = (Guchar *) gmalloc(maskWidth * maskHeight);
+    const int maskChars = maskWidth * maskHeight;
+    Guchar *data = (Guchar *) gmalloc(maskChars);
     maskStr->reset();
-    maskStr->doGetChars(maskWidth * maskHeight, data);
+    const int readChars = maskStr->doGetChars(maskChars, data);
+    if (unlikely(readChars < maskChars)) {
+      memset(&data[readChars], 0, maskChars - readChars);
+    }
     maskStr->close();
-    maskStr = new AutoFreeMemStream((char *)data, 0, maskWidth * maskHeight, maskStr->getDictObject()->copy());
+    maskStr = new AutoFreeMemStream((char *)data, 0, maskChars, maskStr->getDictObject()->copy());
   }
   imgMaskData.imgStr = new ImageStream(maskStr, maskWidth,
 				       maskColorMap->getNumPixelComps(),

Modified: branches/stable/source/src/libs/poppler/poppler-src/poppler/Stream.cc
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/poppler/Stream.cc	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/poppler/Stream.cc	2018-07-10 17:26:48 UTC (rev 806)
@@ -28,7 +28,7 @@
 // Copyright (C) 2012 Fabio D'Urso <fabiodurso at hotmail.it>
 // Copyright (C) 2012 Even Rouault <even.rouault at mines-paris.org>
 // Copyright (C) 2013, 2017, 2018 Adrian Johnson <ajohnson at redneon.com>
-// Copyright (C) 2013 Adam Reichold <adamreichold at myopera.com>
+// Copyright (C) 2013, 2018 Adam Reichold <adamreichold at myopera.com>
 // Copyright (C) 2013 Pino Toscano <pino at kde.org>
 // Copyright (C) 2015 Suzuki Toshiya <mpsuzuki at hiroshima-u.ac.jp>
 // Copyright (C) 2015 Jason Crain <jason at aquaticape.us>
@@ -572,8 +572,6 @@
   ok = gFalse;
 
   nVals = width * nComps;
-  pixBytes = (nComps * nBits + 7) >> 3;
-  rowBytes = ((nVals * nBits + 7) >> 3) + pixBytes;
   if (width <= 0 || nComps <= 0 || nBits <= 0 ||
       nComps > gfxColorMaxComps ||
       nBits > 16 ||
@@ -581,6 +579,8 @@
       nVals >= (INT_MAX - 7) / nBits) { // check for overflow in rowBytes
     return;
   }
+  pixBytes = (nComps * nBits + 7) >> 3;
+  rowBytes = ((nVals * nBits + 7) >> 3) + pixBytes;
   predLine = (Guchar *)gmalloc(rowBytes);
   memset(predLine, 0, rowBytes);
   predIdx = rowBytes;
@@ -1435,6 +1435,7 @@
   nextBits = 9;
   seqIndex = seqLength = 0;
   first = gTrue;
+  newChar = 0;
 }
 
 int LZWStream::getCode() {
@@ -1444,10 +1445,10 @@
   while (inputBits < nextBits) {
     if ((c = str->getChar()) == EOF)
       return EOF;
-    inputBuf = (inputBuf << 8) | (c & 0xff);
+    inputBuf = (inputBuf << 8) | static_cast<unsigned>(c & 0xff);
     inputBits += 8;
   }
-  code = (inputBuf >> (inputBits - nextBits)) & ((1 << nextBits) - 1);
+  code = static_cast<signed>((inputBuf >> (inputBits - nextBits)) & ((1 << nextBits) - 1));
   inputBits -= nextBits;
   return code;
 }

Modified: branches/stable/source/src/libs/poppler/poppler-src/poppler/Stream.h
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/poppler/Stream.h	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/poppler/Stream.h	2018-07-10 17:26:48 UTC (rev 806)
@@ -24,7 +24,7 @@
 // Copyright (C) 2012, 2013 Fabio D'Urso <fabiodurso at hotmail.it>
 // Copyright (C) 2013, 2017 Adrian Johnson <ajohnson at redneon.com>
 // Copyright (C) 2013 Peter Breitenlohner <peb at mppmu.mpg.de>
-// Copyright (C) 2013 Adam Reichold <adamreichold at myopera.com>
+// Copyright (C) 2013, 2018 Adam Reichold <adamreichold at myopera.com>
 // Copyright (C) 2013 Pino Toscano <pino at kde.org>
 //
 // To see a description of the changes please see the Changelog file that
@@ -823,7 +823,7 @@
   StreamPredictor *pred;	// predictor
   int early;			// early parameter
   GBool eof;			// true if at eof
-  int inputBuf;			// input buffer
+  unsigned int inputBuf;	// input buffer
   int inputBits;		// number of bits in input buffer
   struct {			// decoding table
     int length;

Modified: branches/stable/source/src/libs/poppler/poppler-src/poppler/StructTreeRoot.cc
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/poppler/StructTreeRoot.cc	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/poppler/StructTreeRoot.cc	2018-07-10 17:26:48 UTC (rev 806)
@@ -147,7 +147,6 @@
 	Object value = nums.arrayGet(i + 1);
 	if (value.isArray()) {
 	  vec.resize(value.arrayGetLength());
-	  memset(vec.data(), 0, vec.size()*sizeof(Parent*));
 	  for (int j = 0; j < value.arrayGetLength(); j++) {
 	    Object itemvalue = value.arrayGetNF(j);
 	    if (itemvalue.isRef()) {

Modified: branches/stable/source/src/libs/poppler/poppler-src/poppler/UnicodeMap.cc
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/poppler/UnicodeMap.cc	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/poppler/UnicodeMap.cc	2018-07-10 17:26:48 UTC (rev 806)
@@ -17,6 +17,7 @@
 // Copyright (C) 2017 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2017 Adrian Johnson <ajohnson at redneon.com>
 // Copyright (C) 2017 Jean Ghali <jghali at libertysurf.fr>
+// Copyright (C) 2018 Adam Reichold <adam.reichold at t-online.de>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -139,9 +140,6 @@
   eMaps = nullptr;
   eMapsLen = 0;
   refCnt = 1;
-#ifdef MULTITHREADED
-  gInitMutex(&mutex);
-#endif
 }
 
 UnicodeMap::UnicodeMap(const char *encodingNameA, GBool unicodeOutA,
@@ -154,9 +152,6 @@
   eMaps = nullptr;
   eMapsLen = 0;
   refCnt = 1;
-#ifdef MULTITHREADED
-  gInitMutex(&mutex);
-#endif
 }
 
 UnicodeMap::UnicodeMap(const char *encodingNameA, GBool unicodeOutA,
@@ -168,9 +163,6 @@
   eMaps = nullptr;
   eMapsLen = 0;
   refCnt = 1;
-#ifdef MULTITHREADED
-  gInitMutex(&mutex);
-#endif
 }
 
 UnicodeMap::~UnicodeMap() {
@@ -181,32 +173,88 @@
   if (eMaps) {
     gfree(eMaps);
   }
-#ifdef MULTITHREADED
-  gDestroyMutex(&mutex);
-#endif
 }
 
+UnicodeMap::UnicodeMap(UnicodeMap &&other) noexcept
+  : encodingName{other.encodingName}
+  , kind{other.kind}
+  , unicodeOut{other.unicodeOut}
+  , len{other.len}
+  , eMaps{other.eMaps}
+  , eMapsLen{other.eMapsLen}
+  , refCnt{1}
+{
+  switch (kind) {
+  case unicodeMapUser:
+  case unicodeMapResident:
+    ranges = other.ranges;
+    other.ranges = nullptr;
+    break;
+  case unicodeMapFunc:
+    func = other.func;
+    break;
+  }
+  other.encodingName = nullptr;
+  other.eMaps = nullptr;
+}
+
+UnicodeMap& UnicodeMap::operator=(UnicodeMap &&other) noexcept
+{
+  if (this != &other)
+    swap(other);
+  return *this;
+}
+
+void UnicodeMap::swap(UnicodeMap &other) noexcept
+{
+  using std::swap;
+  swap(encodingName, other.encodingName);
+  swap(unicodeOut, other.unicodeOut);
+  switch (kind) {
+  case unicodeMapUser:
+  case unicodeMapResident:
+    switch (other.kind) {
+    case unicodeMapUser:
+    case unicodeMapResident:
+      swap(ranges, other.ranges);
+      break;
+    case unicodeMapFunc:
+    {
+      const auto tmp = ranges;
+      func = other.func;
+      other.ranges = tmp;
+      break;
+    }
+    }
+    break;
+  case unicodeMapFunc:
+    switch (other.kind) {
+    case unicodeMapUser:
+    case unicodeMapResident:
+    {
+      const auto tmp = func;
+      ranges = other.ranges;
+      other.func = tmp;
+      break;
+    }
+    case unicodeMapFunc:
+      swap(func, other.func);
+      break;
+    }
+    break;
+  }
+  swap(kind, other.kind);
+  swap(len, other.len);
+  swap(eMaps, other.eMaps);
+  swap(eMapsLen, other.eMapsLen);
+}
+
 void UnicodeMap::incRefCnt() {
-#ifdef MULTITHREADED
-  gLockMutex(&mutex);
-#endif
-  ++refCnt;
-#ifdef MULTITHREADED
-  gUnlockMutex(&mutex);
-#endif
+  refCnt.fetch_add(1);
 }
 
 void UnicodeMap::decRefCnt() {
-  GBool done;
-
-#ifdef MULTITHREADED
-  gLockMutex(&mutex);
-#endif
-  done = --refCnt == 0;
-#ifdef MULTITHREADED
-  gUnlockMutex(&mutex);
-#endif
-  if (done) {
+  if (refCnt.fetch_sub(1) == 1) {
     delete this;
   }
 }

Modified: branches/stable/source/src/libs/poppler/poppler-src/poppler/UnicodeMap.h
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/poppler/UnicodeMap.h	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/poppler/UnicodeMap.h	2018-07-10 17:26:48 UTC (rev 806)
@@ -17,6 +17,7 @@
 //
 // Copyright (C) 2017 Adrian Johnson <ajohnson at redneon.com>
 // Copyright (C) 2018 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2018 Adam Reichold <adam.reichold at t-online.de>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -33,11 +34,8 @@
 #include "poppler-config.h"
 #include "goo/gtypes.h"
 #include "CharTypes.h"
+#include <atomic>
 
-#ifdef MULTITHREADED
-#include "goo/GooMutex.h"
-#endif
-
 class GooString;
 
 //------------------------------------------------------------------------
@@ -75,6 +73,11 @@
   UnicodeMap(const char *encodingNameA, GBool unicodeOutA,
 	     UnicodeMapFunc funcA);
 
+  UnicodeMap(UnicodeMap &&other) noexcept;
+  UnicodeMap& operator=(UnicodeMap &&other) noexcept;
+
+  void swap(UnicodeMap& other) noexcept;
+
   ~UnicodeMap();
 
   UnicodeMap(const UnicodeMap &) = delete;
@@ -111,10 +114,7 @@
   int len;			// (user, resident)
   UnicodeMapExt *eMaps;		// (user)
   int eMapsLen;			// (user)
-  int refCnt;
-#ifdef MULTITHREADED
-  GooMutex mutex;
-#endif
+  std::atomic_int refCnt;
 };
 
 //------------------------------------------------------------------------

Modified: branches/stable/source/src/libs/poppler/poppler-src/poppler/XRef.cc
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/poppler/XRef.cc	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/poppler/XRef.cc	2018-07-10 17:26:48 UTC (rev 806)
@@ -574,7 +574,7 @@
       goto err0;
     }
     n = obj.getInt();
-    if (first < 0 || n < 0 || first + n < 0) {
+    if (first < 0 || n < 0 || first > INT_MAX - n) {
       goto err0;
     }
     if (first + n > size) {
@@ -789,6 +789,9 @@
   unsigned long long offset, gen;
   int type, c, i, j;
 
+  if (first > INT_MAX - n) {
+    return gFalse;
+  }
   if (first + n < 0) {
     return gFalse;
   }
@@ -866,7 +869,6 @@
   char buf[256];
   Goffset pos;
   int num, gen;
-  int newSize;
   int streamEndsSize;
   char *p;
   GBool gotRoot;
@@ -940,11 +942,11 @@
           if ((*p & 0xff) == 0) {
             //new line, continue with next line!
             str->getLine(buf, 256);
-            p = buf - 1;
-          }
-	  do {
+            p = buf;
+          } else {
 	    ++p;
-	  } while (*p && isspace(*p & 0xff));
+	  }
+	  while (*p && isspace(*p & 0xff)) ++p;
 	  if (isdigit(*p & 0xff)) {
 	    gen = atoi(p);
 	    do {
@@ -954,14 +956,18 @@
               if ((*p & 0xff) == 0) {
                 //new line, continue with next line!
                 str->getLine(buf, 256);
-                p = buf - 1;
-              }
-	      do {
+                p = buf;
+              } else {
 		++p;
-	      } while (*p && isspace(*p & 0xff));
+	      }
+	      while (*p && isspace(*p & 0xff)) ++p;
 	      if (!strncmp(p, "obj", 3)) {
 		if (num >= size) {
-		  newSize = (num + 1 + 255) & ~255;
+		  if (unlikely(num >= INT_MAX - 1 - 255)) {
+		    error(errSyntaxError, -1, "Bad object number");
+		    return gFalse;
+		  }
+		  const int newSize = (num + 1 + 255) & ~255;
 		  if (newSize < 0) {
 		    error(errSyntaxError, -1, "Bad object number");
 		    return gFalse;
@@ -1135,7 +1141,7 @@
 
   case xrefEntryUncompressed:
   {
-    if (e->gen != gen) {
+    if (e->gen != gen || e->offset < 0) {
       goto err;
     }
     parser = new Parser(this,

Modified: branches/stable/source/src/libs/poppler/poppler-src/splash/SplashTypes.h
===================================================================
--- branches/stable/source/src/libs/poppler/poppler-src/splash/SplashTypes.h	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/poppler-src/splash/SplashTypes.h	2018-07-10 17:26:48 UTC (rev 806)
@@ -17,6 +17,7 @@
 // Copyright (C) 2009 Stefan Thomas <thomas at eload24.com>
 // Copyright (C) 2010 William Bader <williambader at hotmail.com>
 // Copyright (C) 2017 Adrian Johnson <ajohnson at redneon.com>
+// Copyright (C) 2018 Stefan Brüns <stefan.bruens at rwth-aachen.de>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -126,7 +127,7 @@
   dest[2] = 0;
 #ifdef SPLASH_CMYK
   dest[3] = 0;
-  for (int i = SPOT_NCOMPS; i < SPOT_NCOMPS + 4; i++)
+  for (int i = 4; i < SPOT_NCOMPS + 4; i++)
     dest[i] = 0;
 #endif
 }
@@ -137,7 +138,7 @@
   dest[2] = src[2];
 #ifdef SPLASH_CMYK
   dest[3] = src[3];
-  for (int i = SPOT_NCOMPS; i < SPOT_NCOMPS + 4; i++)
+  for (int i = 4; i < SPOT_NCOMPS + 4; i++)
     dest[i] = src[i];
 #endif
 }
@@ -148,7 +149,7 @@
   dest[2] ^= src[2];
 #ifdef SPLASH_CMYK
   dest[3] ^= src[3];
-  for (int i = SPOT_NCOMPS; i < SPOT_NCOMPS + 4; i++)
+  for (int i = 4; i < SPOT_NCOMPS + 4; i++)
     dest[i] ^= src[i];
 #endif
 }

Modified: branches/stable/source/src/libs/poppler/version.ac
===================================================================
--- branches/stable/source/src/libs/poppler/version.ac	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/libs/poppler/version.ac	2018-07-10 17:26:48 UTC (rev 806)
@@ -1,4 +1,4 @@
-dnl $Id: version.ac 47480 2018-04-29 00:37:13Z kakuto $
+dnl $Id: version.ac 48060 2018-06-20 05:54:15Z kakuto $
 dnl   Copyright 2018 Karl Berry <tex-live at tug.org>
 dnl   Copyright 2011-2015 Peter Breitenlohner <tex-live at tug.org>
 dnl
@@ -9,4 +9,4 @@
 dnl --------------------------------------------------------
 dnl
 dnl  m4-include this file to define the current poppler version
-m4_define([poppler_version], [0.64.0])
+m4_define([poppler_version], [0.66.0])

Modified: branches/stable/source/src/texk/README
===================================================================
--- branches/stable/source/src/texk/README	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/texk/README	2018-07-10 17:26:48 UTC (rev 806)
@@ -1,4 +1,4 @@
-$Id: README 47608 2018-05-04 04:54:00Z kakuto $
+$Id: README 48164 2018-07-08 08:06:14Z kakuto $
 Copyright 2006-2018 TeX Users Group.
 You may freely use, modify and/or distribute this file.
 
@@ -34,8 +34,9 @@
 cjkutils 4.8.4 - checked 18apr15
   http://cjk.ffii.org/cjk-4.8.4.tar.gz
 
-detex 2.8 - checked 10may12
-  http://www.cs.purdue.edu/homes/trinkle/detex/
+detex 2.8.3 - checked 20jun18
+  https://github.com/pkubowicz/opendetex
+    old info: http://www.cs.purdue.edu/homes/trinkle/detex/
 
 dtl - ?
 
@@ -59,7 +60,7 @@
 
 dvipsk - maintained here, by us
 
-dvisvgm 2.4 - checked 04may18
+dvisvgm 2.4.1 - checked 08jul18
   http://dvisvgm.bplaced.net/Downloads
 
 gregorio 5.1.1 - checked 25mar18

Modified: branches/stable/source/src/texk/kpathsea/ChangeLog
===================================================================
--- branches/stable/source/src/texk/kpathsea/ChangeLog	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/texk/kpathsea/ChangeLog	2018-07-10 17:26:48 UTC (rev 806)
@@ -1,3 +1,21 @@
+2018-07-02  Karl Berry  <karl at freefriends.org>
+
+	* kpsewhich.c (lookup): warn that --all is ignored with bitmap fonts.
+	(USAGE): likewise.
+	* doc/kpathsea.texi (Path searching options) <--all>: likewise.
+	Report from Werner Lember, 07 Apr 2018 12:39:34.
+
+2018-06-10  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
+
+	* progname.c, types.h, knj.h: Add a variable W32_codepage.
+	* kpsewhich.c: Allow Unicode file name for pdftex in kpsewhich.
+	(Windows only)
+
+2018-05-29  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
+
+	* kpsewhich.c: Revert. Since "command_line_encoding=utf8" is
+	not so natural for pdfTeX.
+
 2018-05-12  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
 
 	* kpsewhich.c: Allow Unicode file name for pdftex in kpsewhich.

Modified: branches/stable/source/src/texk/kpathsea/Makefile.am
===================================================================
--- branches/stable/source/src/texk/kpathsea/Makefile.am	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/texk/kpathsea/Makefile.am	2018-07-10 17:26:48 UTC (rev 806)
@@ -1,4 +1,4 @@
-## $Id: Makefile.am 43617 2017-03-27 18:00:45Z karl $
+## $Id: Makefile.am 47973 2018-06-10 06:12:41Z takuji $
 ## Makefile.am for the TeX Live subdirectory texk/kpathsea/
 ##
 ## Copyright 2017 Karl Berry <tex-live at tug.org>
@@ -283,7 +283,7 @@
 if !WIN32
 	@for f in $(dist_noinst_SCRIPTS); do \
 	  if grep "original $$f --" "$(DESTDIR)$(bindir)/$$f" >/dev/null 2>&1; then \
-	    echo " rm\xA0-f '$(DESTDIR)$(bindir)/$$f'"; \
+	    echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
 	    rm -f "$(DESTDIR)$(bindir)/$$f"; \
 	  else :; fi; \
 	done
@@ -290,7 +290,7 @@
 endif !WIN32
 	@for f in $(dist_noinst_DATA); do \
 	  if grep "original $$f --" "$(DESTDIR)$(web2cdir)/$$f" >/dev/null 2>&1; then \
-	    echo " rm\xA0-f '$(DESTDIR)$(web2cdir)/$$f'"; \
+	    echo " rm -f '$(DESTDIR)$(web2cdir)/$$f'"; \
 	    rm -f "$(DESTDIR)$(web2cdir)/$$f"; \
 	  else :; fi; \
 	done

Modified: branches/stable/source/src/texk/kpathsea/Makefile.in
===================================================================
--- branches/stable/source/src/texk/kpathsea/Makefile.in	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/texk/kpathsea/Makefile.in	2018-07-10 17:26:48 UTC (rev 806)
@@ -2497,18 +2497,18 @@
 uninstall-local:
 @WIN32_FALSE@	@for f in $(dist_noinst_SCRIPTS); do \
 @WIN32_FALSE@	  if grep "original $$f --" "$(DESTDIR)$(bindir)/$$f" >/dev/null 2>&1; then \
- at WIN32_FALSE@	    echo " rm\xA0-f '$(DESTDIR)$(bindir)/$$f'"; \
+ at WIN32_FALSE@	    echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
 @WIN32_FALSE@	    rm -f "$(DESTDIR)$(bindir)/$$f"; \
 @WIN32_FALSE@	  else :; fi; \
 @WIN32_FALSE@	done
 	@for f in $(dist_noinst_DATA); do \
 	  if grep "original $$f --" "$(DESTDIR)$(web2cdir)/$$f" >/dev/null 2>&1; then \
-	    echo " rm\xA0-f '$(DESTDIR)$(web2cdir)/$$f'"; \
+	    echo " rm -f '$(DESTDIR)$(web2cdir)/$$f'"; \
 	    rm -f "$(DESTDIR)$(web2cdir)/$$f"; \
 	  else :; fi; \
 	done
 
-# $Id: Makefile.in 47714 2018-05-14 18:07:32Z karl $
+# $Id: Makefile.in 47973 2018-06-10 06:12:41Z takuji $
 # am/bin_links.am: Makefile fragment for bindir links.
 .PHONY: install-bin-links uninstall-bin-links
 

Modified: branches/stable/source/src/texk/kpathsea/doc/kpathsea.info
===================================================================
--- branches/stable/source/src/texk/kpathsea/doc/kpathsea.info	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/texk/kpathsea/doc/kpathsea.info	2018-07-10 17:26:48 UTC (rev 806)
@@ -37,7 +37,7 @@
 ****************
 
 This manual documents the Kpathsea library for path searching.  It
-corresponds to version 6.3.0, released in February 2018.
+corresponds to version 6.3.0, released in July 2018.
 
 * Menu:
 
@@ -62,7 +62,7 @@
 **************
 
 This manual corresponds to version 6.3.0 of the Kpathsea library,
-released in February 2018.
+released in July 2018.
 
    The library's fundamental purpose is to return a filename from a list
 of directories specified by the user, similar to what shells do when
@@ -1153,7 +1153,8 @@
 '--all'
      Report all matches found, one per line.  By default, if there is
      more than one match, just one will be reported (chosen effectively
-     at random).
+     at random).  Exception: with the glyph formats ('pk', 'gf'), this
+     option has no effect and only the first match is returned.
 
 '--casefold-search'
 '--no-casefold-search'
@@ -2942,41 +2943,41 @@
 * --all:                                 Path searching options.
                                                               (line  12)
 * --casefold-search:                     Path searching options.
-                                                              (line  18)
+                                                              (line  19)
 * --color=tty:                           ls-R.                (line  21)
 * --debug=NUM:                           Auxiliary tasks.     (line   9)
 * --dpi=NUM:                             Path searching options.
-                                                              (line  27)
+                                                              (line  28)
 * --engine=NAME:                         Path searching options.
-                                                              (line  31)
+                                                              (line  32)
 * --expand-braces=STRING:                Auxiliary tasks.     (line  12)
 * --expand-path=STRING:                  Auxiliary tasks.     (line  16)
 * --expand-var=STRING:                   Auxiliary tasks.     (line  34)
 * --format=NAME:                         Path searching options.
-                                                              (line  47)
+                                                              (line  48)
 * --help:                                Standard options.    (line   8)
 * --help-formats:                        Auxiliary tasks.     (line  39)
 * --interactive:                         Path searching options.
-                                                              (line 129)
+                                                              (line 130)
 * --mktex=FILETYPE:                      Path searching options.
-                                                              (line 134)
+                                                              (line 135)
 * --mode=STRING:                         Path searching options.
-                                                              (line 140)
+                                                              (line 141)
 * --must-exist:                          Path searching options.
-                                                              (line 145)
+                                                              (line 146)
 * --no-casefold-search:                  Path searching options.
-                                                              (line  18)
+                                                              (line  19)
 * --no-mktex=FILETYPE:                   Path searching options.
-                                                              (line 134)
+                                                              (line 135)
 * --path=STRING:                         Path searching options.
-                                                              (line 150)
+                                                              (line 151)
 * --progname=NAME:                       Path searching options.
-                                                              (line 158)
+                                                              (line 159)
 * --safe-in-name=NAME:                   Auxiliary tasks.     (line  45)
 * --safe-out-name=NAME:                  Auxiliary tasks.     (line  45)
 * --show-path=NAME:                      Auxiliary tasks.     (line  51)
 * --subdir=STRING:                       Path searching options.
-                                                              (line 163)
+                                                              (line 164)
 * --var-value=VARIABLE:                  Auxiliary tasks.     (line  57)
 * --version:                             Standard options.    (line  11)
 * --with-mktextex-default:               mktex configuration. (line  12)
@@ -2989,7 +2990,7 @@
 * -1 debugging value:                    Debugging.           (line  23)
 * -A option to ls:                       ls-R.                (line  33)
 * -D NUM:                                Path searching options.
-                                                              (line  27)
+                                                              (line  28)
 * -iname, find predicate:                Casefolding examples.
                                                               (line  78)
 * -L option to ls:                       ls-R.                (line  38)
@@ -3268,7 +3269,7 @@
 * ENCFONTS:                              Supported file formats.
                                                               (line  61)
 * engine name:                           Path searching options.
-                                                              (line  31)
+                                                              (line  32)
 * environment variable, source for path: Path sources.        (line   9)
 * environment variables for TeX:         Supported file formats.
                                                               (line   6)
@@ -3376,7 +3377,7 @@
                                                               (line  84)
 * input lines, reading:                  Calling sequence.    (line 110)
 * interactive query:                     Path searching options.
-                                                              (line 129)
+                                                              (line 130)
 * interface, not frozen:                 Introduction.        (line  29)
 * introduction:                          Introduction.        (line   6)
 * kdebug::                               Debugging.           (line 105)
@@ -3599,7 +3600,7 @@
 * reporting bugs:                        Reporting bugs.      (line   6)
 * resident.c:                            Calling sequence.    (line  47)
 * resolution, setting:                   Path searching options.
-                                                              (line  27)
+                                                              (line  28)
 * resolutions, last-resort:              Fallback font.       (line   6)
 * retrieving TeX:                        unixtex.ftp.         (line   6)
 * right-hand side of variable assignments: Config files.      (line  56)
@@ -3846,61 +3847,61 @@
 
 Tag Table:
 Node: Top1480
-Node: Introduction2263
-Node: History4336
-Node: unixtex.ftp8932
-Node: Security10357
-Node: TeX directory structure12861
-Node: Path searching16909
-Node: Searching overview17636
-Node: Path sources21455
-Node: Config files22546
-Node: Path expansion26473
-Node: Default expansion27426
-Node: Variable expansion29496
-Node: Tilde expansion30897
-Node: Brace expansion31877
-Node: KPSE_DOT expansion32802
-Node: Subdirectory expansion33315
-Node: Casefolding search35669
-Node: Casefolding rationale36438
-Node: Casefolding examples37777
-Node: Filename database42827
-Node: ls-R43885
-Node: Filename aliases46780
-Node: Database format47958
-Node: Invoking kpsewhich48971
-Node: Path searching options49926
-Node: Specially-recognized files58327
-Node: Auxiliary tasks59682
-Node: Standard options62021
-Node: TeX support62377
-Node: Supported file formats63731
-Node: File lookup71396
-Node: Glyph lookup73145
-Node: Basic glyph lookup74269
-Node: Fontmap75149
-Node: Fallback font77678
-Node: Suppressing warnings78590
-Node: mktex scripts79717
-Node: mktex configuration80932
-Node: mktex script names86735
-Node: mktex script arguments88121
-Node: Programming89000
-Node: Programming overview89573
-Node: Calling sequence92434
-Node: Program-specific files98966
-Node: Programming with config files99989
-Node: Reporting bugs101301
-Node: Bug checklist101979
-Node: Mailing lists105451
-Node: Debugging106126
-Node: Logging111203
-Node: Common problems113070
-Node: Unable to find files113547
-Node: Slow path searching115957
-Node: Unable to generate fonts117332
-Node: TeX or Metafont failing119803
-Node: Index121156
+Node: Introduction2259
+Node: History4328
+Node: unixtex.ftp8924
+Node: Security10349
+Node: TeX directory structure12853
+Node: Path searching16901
+Node: Searching overview17628
+Node: Path sources21447
+Node: Config files22538
+Node: Path expansion26465
+Node: Default expansion27418
+Node: Variable expansion29488
+Node: Tilde expansion30889
+Node: Brace expansion31869
+Node: KPSE_DOT expansion32794
+Node: Subdirectory expansion33307
+Node: Casefolding search35661
+Node: Casefolding rationale36430
+Node: Casefolding examples37769
+Node: Filename database42819
+Node: ls-R43877
+Node: Filename aliases46772
+Node: Database format47950
+Node: Invoking kpsewhich48963
+Node: Path searching options49918
+Node: Specially-recognized files58437
+Node: Auxiliary tasks59792
+Node: Standard options62131
+Node: TeX support62487
+Node: Supported file formats63841
+Node: File lookup71506
+Node: Glyph lookup73255
+Node: Basic glyph lookup74379
+Node: Fontmap75259
+Node: Fallback font77788
+Node: Suppressing warnings78700
+Node: mktex scripts79827
+Node: mktex configuration81042
+Node: mktex script names86845
+Node: mktex script arguments88231
+Node: Programming89110
+Node: Programming overview89683
+Node: Calling sequence92544
+Node: Program-specific files99076
+Node: Programming with config files100099
+Node: Reporting bugs101411
+Node: Bug checklist102089
+Node: Mailing lists105561
+Node: Debugging106236
+Node: Logging111313
+Node: Common problems113180
+Node: Unable to find files113657
+Node: Slow path searching116067
+Node: Unable to generate fonts117442
+Node: TeX or Metafont failing119913
+Node: Index121266
 
 End Tag Table

Modified: branches/stable/source/src/texk/kpathsea/doc/kpathsea.texi
===================================================================
--- branches/stable/source/src/texk/kpathsea/doc/kpathsea.texi	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/texk/kpathsea/doc/kpathsea.texi	2018-07-10 17:26:48 UTC (rev 806)
@@ -3,7 +3,7 @@
 @settitle Kpathsea: A library for path searching
 
 @set version 6.3.0
- at set month-year February 2018
+ at set month-year July 2018
 
 @copying
 This file documents the Kpathsea library for path searching.
@@ -1436,7 +1436,9 @@
 @opindex --all
 @cindex all matches, finding
 Report all matches found, one per line.  By default, if there is more
-than one match, just one will be reported (chosen effectively at random).
+than one match, just one will be reported (chosen effectively at
+random).  Exception: with the glyph formats (@code{pk}, @code{gf}),
+this option has no effect and only the first match is returned.
 
 @item --casefold-search
 @itemx --no-casefold-search

Modified: branches/stable/source/src/texk/kpathsea/knj.h
===================================================================
--- branches/stable/source/src/texk/kpathsea/knj.h	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/texk/kpathsea/knj.h	2018-07-10 17:26:48 UTC (rev 806)
@@ -46,6 +46,7 @@
 #if defined (KPSE_COMPAT_API)
 #define is_cp932_system kpse_def->Is_cp932_system
 #define file_system_codepage kpse_def->File_system_codepage
+#define win32_codepage kpse_def->Win32_codepage
 
 extern KPSEDLL int isknj(int c);
 extern KPSEDLL int isknj2(int c);

Modified: branches/stable/source/src/texk/kpathsea/kpsewhich.c
===================================================================
--- branches/stable/source/src/texk/kpathsea/kpsewhich.c	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/texk/kpathsea/kpsewhich.c	2018-07-10 17:26:48 UTC (rev 806)
@@ -397,6 +397,13 @@
           unsigned local_dpi = find_dpi (name);
           if (!local_dpi)
             local_dpi = dpi;
+          if (show_all) {
+            /* Because the whole glyph lookup thing is too complicated
+               to try all the alternatives (cmr10.600pk vs.
+               dpi600/cmr10.pk, just for starters).  Patches welcome :).  */
+            WARNING1 ("kpsewhich: Ignoring --all for bitmap font, sorry: %s",
+                      name);
+          }
           ret = kpathsea_find_glyph (kpse, temp,
                                      local_dpi, fmt, &glyph_ret);
           if (temp != name)
@@ -464,7 +471,7 @@
 to also use -engine, or nothing will be returned; in particular,\n\
 -engine=/ will return matching format files for any engine.\n\
 \n\
--all                   output all matches, one per line.\n\
+-all                   output all matches, one per line (no effect with pk/gf).\n\
 [-no]-casefold-search  fall back to case-insensitive search if no exact match.\n\
 -debug=NUM             set debugging flags.\n\
 -D, -dpi=NUM           use a base resolution of NUM; default 600.\n\
@@ -773,7 +780,7 @@
 #ifdef WIN32
   if(strstr(kpse->program_name,"xetex") || strstr(kpse->program_name,"xelatex")
      || strstr(kpse->program_name,"uptex") || strstr(kpse->program_name,"uplatex")
-     || strstr(kpse->program_name,"pdftex")
+     || strstr(kpse->program_name,"pdftex") || strstr(kpse->program_name,"pdflatex")
      || strstr(kpse->program_name,"dvipdfm") || strstr(kpse->program_name,"extractbb")
      || strstr(kpse->program_name,"xbb") || strstr(kpse->program_name,"ebb")
      || strstr(kpse->program_name,"dvips") || strstr(kpse->program_name,"upmendex"))

Modified: branches/stable/source/src/texk/kpathsea/progname.c
===================================================================
--- branches/stable/source/src/texk/kpathsea/progname.c	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/texk/kpathsea/progname.c	2018-07-10 17:26:48 UTC (rev 806)
@@ -496,7 +496,7 @@
 #if defined(WIN32)
   if (!kpse->File_system_codepage)
     kpse->File_system_codepage = AreFileApisANSI() ? GetACP() : GetOEMCP();
-  cp = kpse->File_system_codepage;
+  cp = kpse->Win32_codepage = kpse->File_system_codepage;
   if (cp == 932 || cp == 936 || cp == 950) {
     kpse->Is_cp932_system = cp;
   }

Modified: branches/stable/source/src/texk/kpathsea/types.h
===================================================================
--- branches/stable/source/src/texk/kpathsea/types.h	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/texk/kpathsea/types.h	2018-07-10 17:26:48 UTC (rev 806)
@@ -294,7 +294,7 @@
 #endif /* WIN32 && !__MINGW32__ */
 #if defined(WIN32)
     int Is_cp932_system;
-    int File_system_codepage;
+    int File_system_codepage, Win32_codepage;
     int getc_len;
     int getc_buff[4];
     wchar_t wcbuf;

Modified: branches/stable/source/src/texk/tests/TeXLive/TLConfig.pm
===================================================================
--- branches/stable/source/src/texk/tests/TeXLive/TLConfig.pm	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/texk/tests/TeXLive/TLConfig.pm	2018-07-10 17:26:48 UTC (rev 806)
@@ -1,4 +1,4 @@
-# $Id: TLConfig.pm 46841 2018-03-05 16:31:19Z karl $
+# $Id: TLConfig.pm 48093 2018-06-26 21:03:56Z preining $
 # TeXLive::TLConfig.pm - module exporting configuration values
 # Copyright 2007-2018 Norbert Preining
 # This file is licensed under the GNU General Public License version 2
@@ -6,7 +6,7 @@
 
 package TeXLive::TLConfig;
 
-my $svnrev = '$Revision: 46841 $';
+my $svnrev = '$Revision: 48093 $';
 my $_modulerevision = ($svnrev =~ m/: ([0-9]+) /) ? $1 : "unknown";
 sub module_revision { return $_modulerevision; }
 
@@ -22,8 +22,13 @@
     $MetaCategoriesRegexp
     $CategoriesRegexp
     $DefaultCategory
-    $DefaultContainerFormat
-    $DefaultContainerExtension
+    $DefaultFallbackDownloader
+    @AcceptedFallbackDownloaders
+    %FallbackDownloaderProgram
+    %FallbackDownloaderArgs
+    $DefaultCompressorFormat
+    $CompressorExtRegexp
+    %Compressors
     $InfraLocation
     $DatabaseName
     $PackageBackupDir 
@@ -84,6 +89,9 @@
 
 our $BlockSize = 4096;
 
+# timeout for network connections (wget, LWP) in seconds
+our $NetworkTimeout = 30;
+
 our $Archive = "archive";
 our $TeXLiveServerURL = "http://mirror.ctan.org";
 # from 2009 on we try to put them all into tlnet directly without any
@@ -103,9 +111,41 @@
   $CriticalPackagesRegexp = '^(texlive\.infra|tlperl\.win32$)';
 }
 
+#
+our $DefaultFallbackDownloader = "wget";
+our @AcceptedFallbackDownloaders = qw/curl wget/;
+our %FallbackDownloaderProgram = ( 'wget' => 'wget', 'curl' => 'curl');
+our %FallbackDownloaderArgs = (
+  'curl' => ['--user-agent', 'texlive/curl', '--retry', '10', '--fail', '--location',
+             '--connect-timeout', "$NetworkTimeout", '--silent', '--output'],
+  'wget' => ['--user-agent=texlive/wget', '--tries=10',
+             "--timeout=$NetworkTimeout", '-q', '-O'],
+);
 # the way we package things on the web
-our $DefaultContainerFormat = "xz";
-our $DefaultContainerExtension = "tar.$DefaultContainerFormat";
+our $DefaultCompressorFormat = "xz";
+# priority defines which compressor is selected for backups/rollback containers
+# less is better
+our %Compressors = (
+  "lz4" => {
+    "decompress_args" => ["-dcf"],
+    "compress_args"   => ["-zfmq", "--rm"],
+    "extension"       => "lz4",
+    "priority"        => 10,
+  },
+  "gzip" => {
+    "decompress_args" => ["-dcf"],
+    "compress_args"   => ["-f"],
+    "extension"       => "gz",
+    "priority"        => 20,
+  },
+  "xz" => {
+    "decompress_args" => ["-dcf"],
+    "compress_args"   => ["-zf"],
+    "extension"       => "xz",
+    "priority"        => 30,
+  },
+);
+our $CompressorExtRegexp = "(" . join("|", map { $Compressors{$_}{'extension'} } keys(%Compressors)) . ")";
 
 # archive (not user) settings.
 # these can be overridden by putting them into 00texlive.config.tlpsrc
@@ -114,7 +154,7 @@
 our %TLPDBConfigs = (
   "container_split_src_files" => 1,
   "container_split_doc_files" => 1,
-  "container_format" => $DefaultContainerFormat,
+  "container_format" => $DefaultCompressorFormat,
   "minrelease" => $MinRelease,
   "release" => $ReleaseYear,
   "frozen" => 0,
@@ -194,9 +234,6 @@
 # Comma-separated list of engines which do not exist on all platforms.
 our $PartialEngineSupport = "luajittex,mfluajit";
 
-# timeout for network connections (wget, LWP) in seconds
-our $NetworkTimeout = 30;
-
 # Flags for error handling across the scripts and modules
 # all fine
 our $F_OK = 0;

Modified: branches/stable/source/src/texk/tests/TeXLive/TLUtils.pm
===================================================================
--- branches/stable/source/src/texk/tests/TeXLive/TLUtils.pm	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/texk/tests/TeXLive/TLUtils.pm	2018-07-10 17:26:48 UTC (rev 806)
@@ -1,3 +1,4 @@
+# $Id: TLUtils.pm 48130 2018-07-03 22:24:07Z preining $
 # TeXLive::TLUtils.pm - the inevitable utilities for TeX Live.
 # Copyright 2007-2018 Norbert Preining, Reinhard Kotucha
 # This file is licensed under the GNU General Public License version 2
@@ -5,7 +6,7 @@
 
 package TeXLive::TLUtils;
 
-my $svnrev = '$Revision: 47220 $';
+my $svnrev = '$Revision: 48130 $';
 my $_modulerevision = ($svnrev =~ m/: ([0-9]+) /) ? $1 : "unknown";
 sub module_revision { return $_modulerevision; }
 
@@ -38,6 +39,7 @@
   TeXLive::TLUtils::wsystem($msg, at args);
   TeXLive::TLUtils::xsystem(@args);
   TeXLive::TLUtils::run_cmd($cmd);
+  TeXLive::TLUtils::system_pipe($prog, $infile, $outfile, $removeIn, @extraargs);
 
 =head2 File utilities
 
@@ -53,7 +55,7 @@
   TeXLive::TLUtils::touch(@files);
   TeXLive::TLUtils::collapse_dirs(@files);
   TeXLive::TLUtils::removed_dirs(@files);
-  TeXLive::TLUtils::download_file($path, $destination [, $progs ]);
+  TeXLive::TLUtils::download_file($path, $destination);
   TeXLive::TLUtils::setup_programs($bindir, $platform);
   TeXLive::TLUtils::tlcmp($file, $file);
   TeXLive::TLUtils::nulldev();
@@ -176,6 +178,7 @@
     &wsystem
     &xsystem
     &run_cmd
+    &system_pipe
     &announce_execute_actions
     &add_symlinks
     &remove_symlinks
@@ -197,10 +200,11 @@
     &encode_json
     &True
     &False
+    &SshURIRegex
   );
   @EXPORT = qw(setup_programs download_file process_logging_options
                tldie tlwarn info log debug ddebug dddebug debug_hash
-               win32 xchdir xsystem run_cmd sort_archs);
+               win32 xchdir xsystem run_cmd system_pipe sort_archs);
 }
 
 use Cwd;
@@ -212,6 +216,7 @@
 
 $::opt_verbosity = 0;  # see process_logging_options
 
+our $SshURIRegex = '^((ssh|scp)://([^@]*)@([^/]*)/|([^@]*)@([^:]*):).*$';
 
 =head2 Platform detection
 
@@ -394,7 +399,7 @@
     'win32'            => 'Windows',
     'x86_64-cygwin'    => 'Cygwin on x86_64',
     'x86_64-darwin'       => 'MacOSX current (10.10-) on x86_64',
-    'x86_64-darwinlegacy' => 'MacOSX legacy (10.6-10.10) on x86_64',
+    'x86_64-darwinlegacy' => 'MacOSX legacy (10.6-10.9) on x86_64',
     'x86_64-linux'     => 'GNU/Linux on x86_64',
     'x86_64-linuxmusl' => 'GNU/Linux on x86_64 with musl',
     'x86_64-solaris'   => 'Solaris on x86_64',
@@ -516,7 +521,7 @@
 
 sub initialize_global_tmpdir {
   $::tl_tmpdir = File::Temp::tempdir(CLEANUP => 1);
-  debug("tl_tempdir: creating global tempdir $::tl_tmpdir\n");
+  ddebug("tl_tempdir: creating global tempdir $::tl_tmpdir\n");
   return ($::tl_tmpdir);
 }
 
@@ -530,7 +535,7 @@
 sub tl_tmpdir {
   initialize_global_tmpdir() if (!defined($::tl_tmpdir));
   my $tmp = File::Temp::tempdir(DIR => $::tl_tmpdir, CLEANUP => 1);
-  debug("tl_tempdir: creating tempdir $tmp\n");
+  ddebug("tl_tempdir: creating tempdir $tmp\n");
   return ($tmp);
 }
 
@@ -545,7 +550,7 @@
 sub tl_tmpfile {
   initialize_global_tmpdir() if (!defined($::tl_tmpdir));
   my ($fh, $fn) = File::Temp::tempfile(@_, DIR => $::tl_tmpdir, UNLINK => 1);
-  debug("tl_tempfile: creating tempfile $fn\n");
+  ddebug("tl_tempfile: creating tempfile $fn\n");
   return ($fh, $fn);
 }
 
@@ -620,7 +625,38 @@
   return ($output,$retval);
 }
 
+=item C<system_pipe($prog, $infile, $outfile, $removeIn, @extraargs)>
 
+Runs C<$prog> with C<@extraargs> redirecting stdin from C<$infile>, stdout to C<$outfile>.
+Removes C<$infile> if C<$removeIn> is true.
+
+=cut
+
+sub system_pipe {
+  my ($prog, $infile, $outfile, $removeIn, @extraargs) = @_;
+  
+  my $progQuote = quotify_path_with_spaces($prog);
+  if (win32()) {
+    $infile =~ s!/!\\!g;
+    $outfile =~ s!/!\\!g;
+  }
+  my $infileQuote = "\"$infile\"";
+  my $outfileQuote = "\"$outfile\"";
+  debug("TLUtils::system_pipe: calling $progQuote @extraargs < $infileQuote > $outfileQuote\n");
+  my $retval = system("$progQuote @extraargs < $infileQuote > $outfileQuote");
+  if ($retval != 0) {
+    $retval /= 256 if $retval > 0;
+    debug("TLUtils::system_pipe: system exit code = $retval\n");
+    return 0;
+  } else {
+    if ($removeIn) {
+      debug("TLUtils::system_pipe: removing $infile\n");
+      unlink($infile);
+    }
+    return 1;
+  }
+}
+
 =back
 
 =head2 File utilities
@@ -874,7 +910,7 @@
     } elsif (defined wantarray) {
       return(0);
     } else {
-      die "$0: $reterror\n";
+      die "$0: $reterror";
     }
   }
 }
@@ -1121,7 +1157,7 @@
     chmod $mode, "$outfile";
 
     while ($read = sysread (IN, $buffer, $blocksize)) {
-      die "read($infile) failed: $!\n" unless defined $read;
+      die "read($infile) failed: $!" unless defined $read;
       $offset = 0;
       while ($read) {
         $written = syswrite (OUT, $buffer, $read, $offset);
@@ -2072,7 +2108,8 @@
   my ($xzfile, $checksum, $checksize) = @_;
   debug("check_file $xzfile, $checksum, $checksize\n");
   if (!$checksum && !$checksize) {
-    tlwarn("TLUtils::check_file: neither checksum nor checksize available for $xzfile, cannot check integrity!\n");
+    tlwarn("TLUtils::check_file: neither checksum nor checksize " .
+           "available for $xzfile, cannot check integrity"); 
     return;
   }
   # only run checksum tests if we can actually compute the checksum
@@ -2132,51 +2169,46 @@
     return (0, "nothing to unpack");
   }
 
-  # we assume that $::progs has been set up!
-  my $wget = $::progs{'wget'};
-  my $xzdec = TeXLive::TLUtils::quotify_path_with_spaces($::progs{'xzdec'});
-  if (!defined($wget) || !defined($xzdec)) {
-    return (0, "programs not set up properly");
+  my $decompressorType;
+  my $compressorextension;
+  if ($what =~ m/\.tar\.$CompressorExtRegexp$/) {
+    $compressorextension = $1;
+    $decompressorType = $1 eq "gz" ? "gzip" : $1;
   }
-
-  my $type;
-  if ($what !~ m/\.tar\.xz$/) {
+  if (!$decompressorType) {
     return(0, "don't know how to unpack");
   }
+  # make sure that the found uncompressor type is also available
+  if (!member($decompressorType, @{$::progs{'working_compressors'}})) {
+    return(0, "unsupported container format $decompressorType");
+  }
 
+  # only check the necessary compressor program
+  my $decompressor = $::progs{$decompressorType};
+  my @decompressorArgs = @{$Compressors{$decompressorType}{'decompress_args'}};
+
   my $fn = basename($what);
   my $pkg = $fn;
-  $pkg =~ s/\.tar\.xz$//;
-  my $tarfile;
-  my $remove_xzfile = $remove;
-  my $xzfile = "$tempdir/$fn";
-  $tarfile  = "$tempdir/$fn"; $tarfile =~ s/\.xz$//;
-  my $xzfile_quote;
-  my $tarfile_quote;
-  my $target_quote;
-  if (win32()) {
-    $xzfile =~ s!/!\\!g;
-    $tarfile =~ s!/!\\!g;
-    $target =~ s!/!\\!g;
-  }
-  $xzfile_quote = "\"$xzfile\"";
-  $tarfile_quote = "\"$tarfile\"";
-  $target_quote = "\"$target\"";
-  if ($what =~ m,^(https?|ftp)://,) {
+  $pkg =~ s/\.tar\.$compressorextension$//;
+  my $remove_containerfile = $remove;
+  my $containerfile = "$tempdir/$fn";
+  my $tarfile = "$tempdir/$fn"; 
+  $tarfile =~ s/\.$compressorextension$//;
+  if ($what =~ m,^(https?|ftp)://, || $what =~ m!$SshURIRegex!) {
     # we are installing from the NET
     # check for the presence of $what in $tempdir
-    if (-r $xzfile) {
-      check_file($xzfile, $checksum, $size);
+    if (-r $containerfile) {
+      check_file($containerfile, $checksum, $size);
     }
     # if the file is now not present, we can use it
-    if (! -r $xzfile) {
+    if (! -r $containerfile) {
       # try download the file and put it into temp
-      if (!download_file($what, $xzfile)) {
+      if (!download_file($what, $containerfile)) {
         return(0, "downloading did not succeed");
       }
       # remove false downloads
-      check_file($xzfile, $checksum, $size);
-      if ( ! -r $xzfile ) {
+      check_file($containerfile, $checksum, $size);
+      if ( ! -r $containerfile ) {
         return(0, "downloading did not succeed");
       }
     }
@@ -2185,20 +2217,19 @@
     # copy it to temp
     TeXLive::TLUtils::copy($what, $tempdir);
 
-    check_file($xzfile, $checksum, $size);
-    if (! -r $xzfile) {
+    check_file($containerfile, $checksum, $size);
+    if (! -r $containerfile) {
       return (0, "consistency checks failed");
     }
     # we can remove it afterwards
-    $remove_xzfile = 1;
+    $remove_containerfile = 1;
   }
-  debug("un-xzing $xzfile to $tarfile\n");
-  system("$xzdec < $xzfile_quote > $tarfile_quote");
-  if (! -f $tarfile) {
-    unlink($tarfile, $xzfile);
-    return(0, "Unpacking $xzfile failed");
+  if (!system_pipe($decompressor, $containerfile, $tarfile, $remove_container, @decompressorArgs)
+      ||
+      ! -f $tarfile) {
+    unlink($tarfile, $containerfile);
+    return(0, "Decompressing $containerfile failed");
   }
-  unlink($xzfile) if $remove_xzfile;
   if (untar($tarfile, $target, 1)) {
     return (1, "$pkg");
   } else {
@@ -2299,12 +2330,15 @@
 =item C<setup_programs($bindir, $platform)>
 
 Populate the global C<$::progs> hash containing the paths to the
-programs C<wget>, C<tar>, C<xzdec>. The C<$bindir> argument specifies
-the path to the location of the C<xzdec> binaries, the C<$platform>
+programs C<lz4>, C<tar>, C<wget>, C<xz>. The C<$bindir> argument specifies
+the path to the location of the C<xz> binaries, the C<$platform>
 gives the TeX Live platform name, used as the extension on our
 executables.  If a program is not present in the TeX Live tree, we also
 check along PATH (without the platform extension.)
 
+Check many different downloads and compressors to determine what is
+working.
+
 Return 0 if failure, nonzero if success.
 
 =cut
@@ -2313,48 +2347,134 @@
   my ($bindir, $platform) = @_;
   my $ok = 1;
 
-  $::progs{'wget'} = "wget";
-  $::progs{'xzdec'} = "xzdec";
-  $::progs{'xz'} = "xz";
-  $::progs{'tar'} = "tar";
+  my $isWin = ($^O =~ /^MSWin/i);
 
-  if ($^O =~ /^MSWin/i) {
-    $::progs{'wget'}    = conv_to_w32_path("$bindir/wget/wget.exe");
-    $::progs{'tar'}     = conv_to_w32_path("$bindir/tar.exe");
-    $::progs{'xzdec'} = conv_to_w32_path("$bindir/xz/xzdec.exe");
-    $::progs{'xz'}    = conv_to_w32_path("$bindir/xz/xz.exe");
-    for my $prog ("xzdec", "wget") {
-      my $opt = $prog eq "xzdec" ? "--help" : "--version";
-      my $ret = system("$::progs{$prog} $opt >nul 2>&1"); # on windows
-      if ($ret != 0) {
-        warn "TeXLive::TLUtils::setup_programs (w32) failed";  # no nl for perl
-        warn "$::progs{$prog} $opt failed (status $ret): $!\n";
-        warn "Output is:\n";
-        system ("$::progs{$prog} $opt");
-        warn "\n";
-        $ok = 0;
-      }
-    }
+  if ($isWin) {
+    setup_windows_one('tar', "$bindir/tar.exe", "--version", 1);
+    $platform = "exe";
   } else {
+    # tar needs to be provided by the system!
+    $::progs{'tar'} = "tar";
+
     if (!defined($platform) || ($platform eq "")) {
-      # we assume that we run from uncompressed media, so we can call platform() and
-      # thus also the config.guess script
-      # but we have to setup $::installerdir because the platform script
-      # relies on it
+      # we assume that we run from uncompressed media, so we can call
+      # platform() and thus also the config.guess script but we have to
+      # setup $::installerdir because the platform script relies on it
       $::installerdir = "$bindir/../..";
       $platform = platform();
     }
-    my $s = 0;
-    $s += setup_unix_one('wget', "$bindir/wget/wget.$platform", "--version");
-    $s += setup_unix_one('xzdec',"$bindir/xz/xzdec.$platform","--help");
-    $s += setup_unix_one('xz', "$bindir/xz/xz.$platform", "notest");
-    $ok = ($s == 3);  # failure return unless all are present.
   }
 
+  # setup of the fallback downloaders
+  my @working_downloaders;
+  for my $dltype (@AcceptedFallbackDownloaders) {
+    my $defprog = $FallbackDownloaderProgram{$dltype};
+    # do not warn on errors
+    push @working_downloaders, $dltype if 
+      setup_one(($isWin ? "w32" : "unix"), $defprog,
+                 "$bindir/$dltype/$defprog.$platform", "--version", 1);
+  }
+  $::progs{'working_downloaders'} = [ @working_downloaders ];
+  my @working_compressors;
+  for my $defprog (sort {$Compressors{$a}{'priority'} <=> $Compressors{$b}{'priority'}} keys %Compressors) {
+    # do not warn on errors
+    if (setup_one(($isWin ? "w32" : "unix"), $defprog,
+                  "$bindir/$defprog/$defprog.$platform", "--version", 1)) {
+      push @working_compressors, $defprog;
+      # also set up $::{'compressor'} if not already done
+      # this selects the first one, but we might reset this depending on
+      # TEXLIVE_COMPRESSOR setting, see below
+      defined($::progs{'compressor'}) || ($::progs{'compressor'} = $defprog);
+    }
+  }
+  $::progs{'working_compressors'} = [ @working_compressors ];
+
+  # check whether selected downloader/compressor is working
+  # for downloader we allow 'lwp' as setting, too
+  if ($ENV{'TEXLIVE_DOWNLOADER'} 
+      && $ENV{'TEXLIVE_DOWNLOADER'} ne 'lwp'
+      && !TeXLive::TLUtils::member($ENV{'TEXLIVE_DOWNLOADER'},
+                                   @{$::progs{'working_downloaders'}})) {
+    tlwarn(<<END_DOWNLOADER_BAD);
+Selected download program TEXLIVE_DOWNLOADER=$ENV{'TEXLIVE_DOWNLOADER'}
+is not working!
+Please choose a different downloader or don't set TEXLIVE_DOWNLOADER.
+Detected working downloaders: @{$::progs{'working_downloaders'}}.
+END_DOWNLOADER_BAD
+    $ok = 0;
+  }
+  if ($ENV{'TEXLIVE_COMPRESSOR'}
+      && !TeXLive::TLUtils::member($ENV{'TEXLIVE_COMPRESSOR'},
+                                   @{$::progs{'working_compressors'}})) {
+    tlwarn(<<END_COMPRESSOR_BAD);
+Selected compression program TEXLIVE_COMPRESSOR=$ENV{'TEXLIVE_COMPRESSOR'}
+is not working!
+Please choose a different compressor or don't set TEXLIVE_COMPRESSOR.
+Detected working compressors: @{$::progs{'working_compressors'}}.
+END_COMPRESSOR_BAD
+    $ok = 0;
+  }
+  # setup default compressor $::progs{'compressor'} which is used in
+  # tlmgr in the calls to make_container. By default we have already
+  # chosen the first that is actually working from our list of
+  # @AcceptableCompressors, but let the user override this.
+  if ($ENV{'TEXLIVE_COMPRESSOR'}) {
+    $::progs{'compressor'} = $ENV{'TEXLIVE_COMPRESSOR'};
+  }
+
+  if ($::opt_verbosity >= 2) {
+    require Data::Dumper;
+    use vars qw($Data::Dumper::Indent $Data::Dumper::Sortkeys
+                $Data::Dumper::Purity); # -w pain
+    $Data::Dumper::Indent = 1;
+    $Data::Dumper::Sortkeys = 1;  # stable output
+    $Data::Dumper::Purity = 1; # recursive structures must be safe
+    print STDERR "DD:dumping ";
+    print STDERR Data::Dumper->Dump([\%::progs], [qw(::progs)]);
+  }
   return $ok;
 }
 
+sub setup_one {
+  my ($what, $p, $def, $arg, $donotwarn) = @_;
+  if ($what eq "unix") {
+    return(setup_unix_one($p, $def, $arg, $donotwarn));
+  } else {
+    return(setup_windows_one($p, $def, $arg, $donotwarn));
+  }
+}
 
+sub setup_windows_one {
+  my ($p, $def, $arg, $donotwarn) = @_;
+  debug("(w32) trying to set up $p, default $def, arg $arg\n");
+  my $ready = 0;
+  if (-r $def) {
+    my $prog = conv_to_w32_path($def);
+    my $ret = system("$prog $arg >nul 2>&1"); # on windows
+    if ($ret == 0) {
+      $::progs{$p} = $prog;
+      $ready = 1;
+    } else {
+      tlwarn("Setting up $p with $def as $prog didn't work\n");
+      system("$prog $arg");
+    }
+  } else {
+    debug("Default program $def not readable?\n");
+  }
+  return($ready) if ($ready);
+  # still here, try plain name without any specification
+  debug("trying to test for plain prog name $p\n");
+  $ret = system("$p $arg >nul 2>&1");
+  if ($ret == 0) {
+    debug("program $p seems to be in the path!\n");
+    $::progs{$p} = $p;
+    return(1);
+  }
+  return(0);
+}
+
+
+
 # setup one prog on unix using the following logic:
 # - if the shipped one is -x and can be executed, use it
 # - if the shipped one is -x but cannot be executed, copy it. set -x
@@ -2426,7 +2546,7 @@
           } else {
             # even the copied prog is not executable, strange
             $test_fallback = 1;
-            ddebug("Copied $p $::progs{$p} has x bit but not executable, strange!\n");
+            ddebug("Copied $p $::progs{$p} has x bit but not executable?!\n");
           }
         } else {
           debug("Using copied $::progs{$p} for $p (not tested).\n");
@@ -2434,7 +2554,7 @@
       }
     }
   } else {
-    # hope that we can find in in the global PATH
+    # hope that we can find in the global PATH
     $test_fallback = 1;
   }
   if ($test_fallback) {
@@ -2461,40 +2581,27 @@
   return 1;
 }
 
-=item C<download_file( $relpath, $destination [, $progs ] )>
+

+=item C<download_file( $relpath, $destination )>
 
 Try to download the file given in C<$relpath> from C<$TeXLiveURL>
 into C<$destination>, which can be either
 a filename of simply C<|>. In the latter case a file handle is returned.
 
-The optional argument C<$progs> is a reference to a hash giving full
-paths to the respective programs, at least C<wget>.  If C<$progs> is not
-given the C<%::progs> hash is consulted, and if this also does not exist
-we try a literal C<wget>.
+Downloading first checks for the environment variable C<TEXLIVE_DOWNLOADER>,
+which takes various built-in values. If not set, the next check is fr
+C<TL_DOWNLOAD_PROGRAM> and C<TL_DOWNLOAD_ARGS>. The former overrides the
+above specification devolving to C<wget>, and the latter overrides the
+default wget arguments.
 
-Downloading honors two environment variables: C<TL_DOWNLOAD_PROGRAM> and
-C<TL_DOWNLOAD_ARGS>. The former overrides the above specification
-devolving to C<wget>, and the latter overrides the default wget
-arguments.
-
 C<TL_DOWNLOAD_ARGS> must be defined so that the file the output goes to
-is the first argument after the C<TL_DOWNLOAD_ARGS>.  Thus, typically it
+is the first argument after the C<TL_DOWNLOAD_ARGS>.  Thus, for wget it
 would end in C<-O>.  Use with care.
 
 =cut
 
 sub download_file {
-  my ($relpath, $dest, $progs) = @_;
-  my $wget;
-  if (defined($progs) && defined($progs->{'wget'})) {
-    $wget = $progs->{'wget'};
-  } elsif (defined($::progs{'wget'})) {
-    $wget = $::progs{'wget'};
-  } else {
-    tlwarn ("download_file: Programs not set up, trying literal wget\n");
-    $wget = "wget";
-  }
-  #
+  my ($relpath, $dest) = @_;
   # create output dir if necessary
   my $par;
   if ($dest ne "|") {
@@ -2518,6 +2625,34 @@
       return 0;
     }
   }
+
+  if ($relpath =~ m!$SshURIRegex!) {
+    my $downdest;
+    if ($dest eq "|") {
+      my ($fh, $fn) = TeXLive::TLUtils::tl_tmpfile();
+      $downdest = $fn;
+    } else {
+      $downdest = $dest;
+    }
+    # massage ssh:// into the scp-acceptable scp://
+    $relpath =~ s!^ssh://!scp://!;
+    my $retval = system("scp", "-q", $relpath, $downdest);
+    if ($retval != 0) {
+      $retval /= 256 if $retval > 0;
+      my $pwd = cwd ();
+      tlwarn("$0: system(scp -q $relpath $downdest) failed in $pwd, status $retval");
+      return 0;
+    }
+    if ($dest eq "|") {
+      open(RETFH, "<$downdest") or
+        die("Cannot open $downdest for reading");
+      # opening to a pipe always succeeds, so we return immediately
+      return \*RETFH;
+    } else {
+      return 1;
+    }
+  }
+
   if ($relpath =~ /^(https?|ftp):\/\//) {
     $url = $relpath;
   } else {
@@ -2524,10 +2659,44 @@
     $url = "$TeXLiveURL/$relpath";
   }
 
-  my $wget_retry = 0;
+  my @downloader_trials;
+  if ($ENV{'TEXLIVE_DOWNLOADER'}) {
+    push @downloader_trials, $ENV{'TEXLIVE_DOWNLOADER'};
+  } elsif ($ENV{"TL_DOWNLOAD_PROGRAM"}) {
+    push @downloader_trials, 'custom';
+  } else {
+    @downloader_trials = qw/lwp curl wget/;
+  }
+
+  my $success = 0;
+  for my $downtype (@downloader_trials) {
+    if ($downtype eq 'lwp') {
+      if (_download_file_lwp($url, $dest)) {
+        $success = $downtype;
+        last;
+      }
+    }
+    if ($downtype eq "custom" || TeXLive::TLUtils::member($downtype, @{$::progs{'working_downloaders'}})) {
+      if (_download_file_program($url, $dest, $downtype)) {
+        $success = $downtype;
+        last;
+      }
+    }
+  }
+  if ($success) {
+    debug("TLUtils::download_file: downloading using $success succeeded\n");
+    return(1);
+  } else {
+    debug("TLUtils::download_file: tried to download using @downloader_trials, none succeeded\n");
+    return(0);
+  }
+}
+
+sub _download_file_lwp {
+  my ($url, $dest) = @_;
   if (defined($::tldownload_server) && $::tldownload_server->enabled) {
     debug("persistent connection set up, trying to get $url (for $dest)\n");
-    $ret = $::tldownload_server->get_file($url, $dest);
+    my $ret = $::tldownload_server->get_file($url, $dest);
     if ($ret) {
       ddebug("downloading file via persistent connection succeeded\n");
       return $ret;
@@ -2535,48 +2704,50 @@
       debug("TLUtils::download_file: persistent connection ok,"
              . " but download failed: $url\n");
       debug("TLUtils::download_file: retrying with wget.\n");
-      $wget_retry = 1; # just so we can give another msg.
     }
   } else {
     if (!defined($::tldownload_server)) {
-      debug("::tldownload_server not defined\n");
+      ddebug("::tldownload_server not defined\n");
     } else {
-      debug("::tldownload_server->enabled is not set\n");
+      ddebug("::tldownload_server->enabled is not set\n");
     }
-    debug("persistent connection not set up, using wget\n");
+    debug("persistent connection not set up\n");
   }
-  
-  # try again.
-  my $ret = _download_file($url, $dest, $wget);
-  
-  if ($wget_retry) {
-    debug("TLUtils::download_file: retry with wget "
-           . ($ret ? "succeeded" : "failed") . ": $url\n");
-  }
-  
-  return($ret);
+  # if we are still here, download with LWP didn't succeed.
+  return(0);
 }
 
-sub _download_file {
-  my ($url, $dest, $wgetdefault) = @_;
+sub _download_file_program {
+  my ($url, $dest, $type) = @_;
   if (win32()) {
     $dest =~ s!/!\\!g;
   }
+  
+  debug("TLUtils::_download_file_program: $type $url $dest\n");
+  my $downloader;
+  my $downloaderargs;
+  my @downloaderargs;
+  if ($type eq 'custom') {
+    $downloader = $ENV{"TL_DOWNLOAD_PROGRAM"};
+    if ($ENV{"TL_DOWNLOAD_ARGS"}) {
+      $downloaderargs = $ENV{"TL_DOWNLOAD_ARGS"};
+      @downloaderargs = split(' ', $downloaderargs);
+    }
+  } else {
+    $downloader = $::progs{$FallbackDownloaderProgram{$type}};
+    @downloaderargs = @{$FallbackDownloaderArgs{$type}};
+    $downloaderargs = join(' ', at downloaderargs);
+  }
 
-  my $wget = $ENV{"TL_DOWNLOAD_PROGRAM"} || $wgetdefault;
-  my $wgetargs = $ENV{"TL_DOWNLOAD_ARGS"}
-                 || "--user-agent=texlive/wget --tries=10 --timeout=$NetworkTimeout -q -O";
-
-  debug("downloading $url using $wget $wgetargs\n");
+  debug("downloading $url using $downloader $downloaderargs\n");
   my $ret;
   if ($dest eq "|") {
-    open(RETFH, "$wget $wgetargs - $url|")
-    || die "open($url) via $wget $wgetargs failed: $!";
+    open(RETFH, "$downloader $downloaderargs - $url|")
+    || die "open($url) via $downloader $downloaderargs failed: $!";
     # opening to a pipe always succeeds, so we return immediately
     return \*RETFH;
   } else {
-    my @wgetargs = split (" ", $wgetargs);
-    $ret = system ($wget, @wgetargs, $dest, $url);
+    $ret = system ($downloader, @downloaderargs, $dest, $url);
     # we have to reverse the meaning of ret because system has 0=success.
     $ret = ($ret ? 0 : 1);
   }
@@ -3411,7 +3582,8 @@
 
   # open log file if one was requested.
   if ($opt_logfile) {
-    open(TLUTILS_LOGFILE, ">$opt_logfile") || die "open(>$opt_logfile) failed: $!\n";
+    open(TLUTILS_LOGFILE, ">$opt_logfile")
+    || die "open(>$opt_logfile) failed: $!\n";
     $::LOGFILE = \*TLUTILS_LOGFILE;
     $::LOGFILENAME = $opt_logfile;
   }
@@ -3736,7 +3908,8 @@
 
 =item C<< download_to_temp_or_file($url) >>
 
-If C<$url> tries to download the file into a temporary file.
+If C<$url> is a url, tries to download the file into a temporary file.
+Otherwise assume that C<$url> is a local file.
 In both cases returns the local file.
 
 Returns the local file name if succeeded, otherwise undef.
@@ -3746,7 +3919,7 @@
 sub download_to_temp_or_file {
   my $url = shift;
   my ($url_fh, $url_file);
-  if ($url =~ m,^(https?|ftp|file)://,) {
+  if ($url =~ m,^(https?|ftp|file)://, || $url =~ m!$SshURIRegex!) {
     ($url_fh, $url_file) = tl_tmpfile();
     # now $url_fh filehandle is open, the file created
     # TLUtils::download_file will just overwrite what is there
@@ -4042,7 +4215,7 @@
       # check whether files exist
       if ($mustexist) {
         foreach my $file (keys %files) {
-          die "File \"$file\" doesn't exist.\n" if (! -f $file);
+          die "mktexupd: exec file does not exist: $file" if (! -f $file);
         }
       }
       my $delim= (&win32)? ';' : ':';
@@ -4160,10 +4333,19 @@
 }
 
 
+=item C<repository_to_array($r)>
+
+Return hash of tags to urls for space-separated list of repositories
+passed in C<$r>. If passed undef or empty string, die.
+
+=cut
+
 sub repository_to_array {
   my $r = shift;
   my %r;
-  my @repos = split ' ', $r;
+  die "internal error, repository_to_array passed nothing (caller="
+      . caller . ")" if (!$r);
+  my @repos = split (' ', $r);
   if ($#repos == 0) {
     # only one repo, this is the main one!
     $r{'main'} = $repos[0];
@@ -4256,7 +4438,7 @@
     # that didn't work out, use home-grown json
     if ($envdefined) {
       # environment asks for JSON but cannot be loaded, die!
-      tldie("env variable TL_JSONMODE request JSON module but cannot be load!\n");
+      tldie("envvar TL_JSONMODE request JSON module but cannot be loaded!\n");
     }
     $jsonmode = "texlive";
     debug("texlive json module used!\n");

Modified: branches/stable/source/src/texk/web2c/ChangeLog
===================================================================
--- branches/stable/source/src/texk/web2c/ChangeLog	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/texk/web2c/ChangeLog	2018-07-10 17:26:48 UTC (rev 806)
@@ -1,3 +1,20 @@
+2018-06-14  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
+
+	* help.h, texmfmp-help.h: remove sjisterminal (w32 only).
+
+2018-06-08  Karl Berry  <karl at freefriends.org>
+
+	* bibtex.ch (142): also try opening subsidiary .aux files
+	via a_open_in_with_dirname.
+	(bib_makecstring): new fn.
+	* cpascal.h (aopeninwithdirname): new #define.
+	* lib/openclose.c (open_input_with_dirname): new fn.
+	* tests/bibtex-auxinclude.test: new test.
+	* tests/auxinclude*.*: files for test.
+	* am/web.am (web_tests): include bibtex-auxinclude.test.
+	Suggestion from John Collins. See thread from
+	http://tug.org/pipermail/tex-live/2018-May/041624.html.
+
 2018-05-03  Karl Berry  <karl at freefriends.org>
 
 	* patgen.ch (trie_size, triec_size): increase greatly.

Modified: branches/stable/source/src/texk/web2c/Makefile.in
===================================================================
--- branches/stable/source/src/texk/web2c/Makefile.in	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/texk/web2c/Makefile.in	2018-07-10 17:26:48 UTC (rev 806)
@@ -2613,7 +2613,8 @@
 	pktype.test pltotf.test pooltype.test tftopl.test vftovp.test \
 	vptovf.test weave.test
 am__EXEEXT_42 = $(am__EXEEXT_41) tests/bibtex-openout-test.pl \
-	tests/bibtex-longline-test.pl tests/bibtex-mem.test
+	tests/bibtex-longline-test.pl tests/bibtex-mem.test \
+	tests/bibtex-auxinclude.test
 @WEB_TRUE at am__EXEEXT_43 = $(am__EXEEXT_42)
 TEST_SUITE_LOG = test-suite.log
 am__test_logs1 = $(TESTS:=.log)
@@ -2972,13 +2973,16 @@
 	ctangleboot.cin cwebboot.cin cwebboot.hin tangle.test \
 	$(web_programs:=.web) $(web_programs:=.ch) $(web_tests) \
 	tests/memdata1.bst tests/memdata2.bst tests/memdata3.bst \
-	tests/allbib.aux tests/allbib.tex tests/apalike.bst \
-	tests/badpl.pl tests/badtfm.tfm tests/badvf.tfm tests/badvf.vf \
-	tests/badvpl.vpl tests/batch.tex tests/check.log \
-	tests/cmr10.600gf tests/cmr10.pk tests/cmr10.pl \
-	tests/cmr10.tfm tests/cmr7.tfm tests/cmr8.tfm tests/cmti10.tfm \
-	tests/cmtt10.tfm tests/cmtt8.tfm tests/dict tests/eight.tex \
-	tests/end.tex tests/exampl.aux tests/exampl.tex tests/gray.tfm \
+	tests/auxinclude.aux tests/auxinclude.bbl tests/auxinclude.bib \
+	tests/auxinclude.tex tests/auxinclude2.aux \
+	tests/auxinclude2.tex tests/allbib.aux tests/allbib.tex \
+	tests/apalike.bst tests/badpl.pl tests/badtfm.tfm \
+	tests/badvf.tfm tests/badvf.vf tests/badvpl.vpl \
+	tests/batch.tex tests/check.log tests/cmr10.600gf \
+	tests/cmr10.pk tests/cmr10.pl tests/cmr10.tfm tests/cmr7.tfm \
+	tests/cmr8.tfm tests/cmti10.tfm tests/cmtt10.tfm \
+	tests/cmtt8.tfm tests/dict tests/eight.tex tests/end.tex \
+	tests/exampl.aux tests/exampl.tex tests/gray.tfm \
 	tests/hello.tex tests/io.mf tests/just.texi tests/label.mp \
 	tests/label.mpx tests/logo8.tfm tests/longline.aux \
 	tests/longline.bib tests/longline.tex tests/longtfm.tex \
@@ -3493,7 +3497,8 @@
 	patgen pktogf pktype pltotf pooltype tftopl vftovp vptovf weave
 
 web_tests = $(web_programs:=.test) tests/bibtex-openout-test.pl \
-	tests/bibtex-longline-test.pl tests/bibtex-mem.test
+	tests/bibtex-longline-test.pl tests/bibtex-mem.test \
+	tests/bibtex-auxinclude.test
 nodist_bibtex_SOURCES = bibtex.c bibtex.h
 nodist_dvicopy_SOURCES = dvicopy.c dvicopy.h
 nodist_dvitype_SOURCES = dvitype.c dvitype.h
@@ -18999,7 +19004,8 @@
 bibtex.p: tangle$(EXEEXT) bibtex.web bibtex.ch
 	$(tangle) bibtex bibtex
 bibtex.log tests/bibtex-openout-test.log tests/bibtex-longline-test.log \
-	tests/bibtex-mem.log: bibtex$(EXEEXT)
+	tests/bibtex-mem.log \
+	tests/bibtex-auxinclude.log: bibtex$(EXEEXT)
 dvicopy.c dvicopy.h: dvicopy-web2c
 	@$(web2c) dvicopy
 dvicopy-web2c: dvicopy.p $(web2c_depend)

Modified: branches/stable/source/src/texk/web2c/NEWS
===================================================================
--- branches/stable/source/src/texk/web2c/NEWS	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/texk/web2c/NEWS	2018-07-10 17:26:48 UTC (rev 806)
@@ -1,5 +1,9 @@
 This file records noteworthy changes.  (Public domain.)
 
+BibTeX: subsidiary .aux files are looked for in the directory of the
+main .aux file, if not found as-is (to work better with -output-directory).
+
+

 2018 (for TeX Live 2018, 14 April 2018)
 * Directories in the -output-directory do not mask files by the same name.
 

Modified: branches/stable/source/src/texk/web2c/am/web.am
===================================================================
--- branches/stable/source/src/texk/web2c/am/web.am	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/texk/web2c/am/web.am	2018-07-10 17:26:48 UTC (rev 806)
@@ -1,6 +1,7 @@
 ## texk/web2c/am/web.am: Makefile fragment for normal web programs (except tangle).
 ##
-## Copyright (C) 2009-2015 Peter Breitenlohner <tex-live at tug.org>
+## Copyright 2018 Karl Berry <tex-live at tug.org>
+## Copyright 2009-2015 Peter Breitenlohner <tex-live at tug.org>
 ## You may freely use, modify and/or distribute this file.
 
 web_programs = bibtex dvicopy dvitype gftodvi gftopk gftype mft \
@@ -28,8 +29,10 @@
 	$(tangle) bibtex bibtex
 web_tests += tests/bibtex-openout-test.pl tests/bibtex-longline-test.pl
 web_tests += tests/bibtex-mem.test
+web_tests += tests/bibtex-auxinclude.test
 bibtex.log tests/bibtex-openout-test.log tests/bibtex-longline-test.log \
-	tests/bibtex-mem.log: bibtex$(EXEEXT)
+	tests/bibtex-mem.log \
+	tests/bibtex-auxinclude.log: bibtex$(EXEEXT)
 
 nodist_dvicopy_SOURCES = dvicopy.c dvicopy.h
 dvicopy.c dvicopy.h: dvicopy-web2c
@@ -181,6 +184,9 @@
 ## tests/bibtex-mem.test
 EXTRA_DIST += tests/memdata1.bst tests/memdata2.bst tests/memdata3.bst
 DISTCLEANFILES += tests/memtest.bib tests/memtest?.*
+## tests/bibtex-auxinclinde.test
+EXTRA_DIST += tests/auxinclude.aux tests/auxinclude.bbl tests/auxinclude.bib
+EXTRA_DIST += tests/auxinclude.tex tests/auxinclude2.aux tests/auxinclude2.tex
 ## dvicopy.test
 DISTCLEANFILES += tests/xstory.dvi tests/xpplr.dvi
 ## dvitype.test

Modified: branches/stable/source/src/texk/web2c/cpascal.h
===================================================================
--- branches/stable/source/src/texk/web2c/cpascal.h	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/texk/web2c/cpascal.h	2018-07-10 17:26:48 UTC (rev 806)
@@ -141,6 +141,9 @@
 #define aopenout(f)  open_output (&(f), FOPEN_W_MODE)
 #define aclose close_file
 
+/* Used in BibTeX for subsidiary aux files. */
+#define aopeninwithdirname(f,p,s) open_input_with_dirname (&(f), p, s)
+
 /* How to output to the GF or DVI file.  */
 #define WRITE_OUT(a, b)							\
   if ((size_t) fwrite ((char *) &OUT_BUF[a], sizeof (OUT_BUF[a]),       \

Modified: branches/stable/source/src/texk/web2c/help.h
===================================================================
--- branches/stable/source/src/texk/web2c/help.h	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/texk/web2c/help.h	2018-07-10 17:26:48 UTC (rev 806)
@@ -333,9 +333,6 @@
     "",
     "-kanji=STRING          set Japanese encoding (STRING=euc|jis|sjis|utf8)",
     "-min-crossrefs=NUMBER  include item after NUMBER cross-refs; default 2",
-#if defined(WIN32)
-    "-sjis-terminal         always output to stdout and stderr by CP932",
-#endif
     "-terse                 do not print progress reports",
     "-help                  display this help and exit",
     "-version               output version information and exit",
@@ -357,9 +354,6 @@
     "-output-level=NUMBER   verbosity level, from 0 to 4; default 4",
     "-page-start=PAGE-SPEC  start at PAGE-SPEC, for example `2' or `5.*.-2'",
     "-show-opcodes          show numeric opcodes (in decimal)",
-#if defined(WIN32)
-    "-sjis-terminal         always output to stdout and stderr by CP932",
-#endif
     "-help                  display this help and exit",
     "-version               output version information and exit",
     NULL
@@ -423,9 +417,6 @@
     "  Default TFMFILE is basename of PLFILE extended with `.tfm'.",
     "",
     "-kanji=STRING          set Japanese encoding (STRING=euc|jis|sjis|utf8)",
-#if defined(WIN32)
-    "-sjis-terminal         always output to stdout and stderr by CP932",
-#endif
     "-help                  print this message and exit.",
     "-verbose               output progress reports.",
     "-version               print version information and exit.",
@@ -444,9 +435,6 @@
     "                        either `octal' or `ascii'; default is ascii for",
     "                        letters and digits, octal for all else",
     "-kanji=STRING          set Japanese encoding (STRING=euc|jis|sjis|utf8)",
-#if defined(WIN32)
-    "-sjis-terminal         always output to stdout and stderr by CP932",
-#endif
     "-help                  display this help and exit",
     "-verbose               display progress reports",
     "-version               output version information and exit",
@@ -504,9 +492,6 @@
     "-kanji=STRING          set Japanese encoding (STRING=euc|jis|sjis|utf8|uptex)",
     "-kanji-internal=STRING set Japanese internal encoding (STRING=euc|uptex)",
     "-min-crossrefs=NUMBER  include item after NUMBER cross-refs; default 2",
-#if defined(WIN32)
-    "-sjis-terminal         always output to stdout and stderr by CP932",
-#endif
     "-terse                 do not print progress reports",
     "-help                  display this help and exit",
     "-version               output version information and exit",
@@ -528,9 +513,6 @@
     "-output-level=NUMBER   verbosity level, from 0 to 4; default 4",
     "-page-start=PAGE-SPEC  start at PAGE-SPEC, for example `2' or `5.*.-2'",
     "-show-opcodes          show numeric opcodes (in decimal)",
-#if defined(WIN32)
-    "-sjis-terminal         always output to stdout and stderr by CP932",
-#endif
     "-help                  display this help and exit",
     "-version               output version information and exit",
     NULL
@@ -545,9 +527,6 @@
     "  Default TFMFILE is basename of PLFILE extended with `.tfm'.",
     "",
     "-kanji=STRING          set Japanese encoding (STRING=euc|jis|sjis|utf8|uptex)",
-#if defined(WIN32)
-    "-sjis-terminal         always output to stdout and stderr by CP932",
-#endif
     "-help                  print this message and exit.",
     "-verbose               output progress reports.",
     "-version               print version information and exit.",
@@ -566,9 +545,6 @@
     "                        either `octal' or `ascii'; default is ascii for",
     "                        letters and digits, octal for all else",
     "-kanji=STRING          set Japanese encoding (STRING=euc|jis|sjis|utf8|uptex)",
-#if defined(WIN32)
-    "-sjis-terminal         always output to stdout and stderr by CP932",
-#endif
     "-help                  display this help and exit",
     "-verbose               display progress reports",
     "-version               output version information and exit",

Modified: branches/stable/source/src/texk/web2c/lib/ChangeLog
===================================================================
--- branches/stable/source/src/texk/web2c/lib/ChangeLog	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/texk/web2c/lib/ChangeLog	2018-07-10 17:26:48 UTC (rev 806)
@@ -1,3 +1,30 @@
+2018-06-28  Karl Berry  <karl at freefriends.org>
+
+	* openclose.c (open_input_with_dirname): do not prepend the
+	top-level directory name if the subsidiary aux file being searched
+	for is alrady absolute. Private report from John Collins
+	(22 Jun 2018 14:01:31).
+
+2018-06-14  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
+
+	* texmfmp.c: remove sjisterminal (w32 only).
+
+2018-06-10  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
+
+	* texmfmp.c: Allow non-ascii file names for pdfTeX
+	with UTF-8 source files (w32 only).
+
+2018-06-09  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
+
+	* texmfmp.c, openclose.c: Support UTF-8 file names
+	on UTF-8 locale in pTeX (Unix-like platform only).
+
+2018-05-29  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
+
+	* texmfmp.c: Discard the changes for pdfTeX on 2018-05-11,
+	since 'command_line_encoding=utf-8' is not so natural
+	for pdfTeX (w32 only).
+
 2018-05-12  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
 
 	* texmfmp.c: Allow non-ascii file names for pdfTeX (w32 only).

Modified: branches/stable/source/src/texk/web2c/lib/openclose.c
===================================================================
--- branches/stable/source/src/texk/web2c/lib/openclose.c	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/texk/web2c/lib/openclose.c	2018-07-10 17:26:48 UTC (rev 806)
@@ -141,7 +141,7 @@
     recorder_record_name ("OUTPUT", name);
 }
 

-/* Open an input file F, using the kpathsea format FILEFMT and passing
+/* Open input file *F_PTR, using the kpathsea format FILEFMT and passing
    FOPEN_MODE to fopen.  The filename is in `nameoffile+1'.  We return
    whether or not the open succeeded.  If it did, `nameoffile' is set to
    the full filename opened, and `namelength' to its length.  */
@@ -150,6 +150,9 @@
 open_input (FILE **f_ptr, int filefmt, const_string fopen_mode)
 {
     string fname = NULL;
+#if defined(PTEX) && !defined(WIN32)
+    string fname0;
+#endif
 #ifdef FUNNY_CORE_DUMP
     /* This only applies if a preloaded TeX/Metafont is being made;
        it allows automatic creation of the core dump (typing ^\ loses
@@ -170,6 +173,17 @@
        absolute.  This is because .aux and other such files will get
        written to the output directory, and we have to be able to read
        them from there.  We only look for the name as-is.  */
+
+#if defined(PTEX) && !defined(WIN32)
+    fname0 = ptenc_from_internal_enc_string_to_utf8(nameoffile + 1);
+    if (fname0) {
+        free (nameoffile);
+        namelength = strlen (fname0);
+        nameoffile = xmalloc (namelength + 2);
+        strcpy (nameoffile + 1, fname0);
+        free (fname0);
+    }
+#endif
     if (output_directory && !kpse_absolute_p (nameoffile+1, false)) {
         fname = concat3 (output_directory, DIR_SEP_STRING, nameoffile + 1);
         *f_ptr = fopen (fname, fopen_mode);
@@ -183,6 +197,13 @@
         }
 #endif
         if (*f_ptr) {
+#if defined(PTEX) && !defined(WIN32)
+            fname0 = ptenc_from_utf8_string_to_internal_enc(fname);
+            if (fname0) {
+                free (fname);
+                fname = fname0;
+            }
+#endif
             free (nameoffile);
             namelength = strlen (fname);
             nameoffile = xmalloc (namelength + 2);
@@ -205,7 +226,8 @@
                which we set `tex_input_type' to 0 in the change file.  */
             /* According to the pdfTeX people, pounding the disk for .vf files
                is overkill as well.  A more general solution would be nice. */
-            boolean must_exist = (filefmt != kpse_tex_format || texinputtype)
+            boolean must_exist;
+            must_exist = (filefmt != kpse_tex_format || texinputtype)
                     && (filefmt != kpse_vf_format);
             fname = kpse_find_file (nameoffile + 1,
                                     (kpse_file_format_type)filefmt,
@@ -229,21 +251,28 @@
                     fname[i] = 0;
                 }
 
+                /* This fopen is not allowed to fail. */
+#if defined(PTEX) && !defined(WIN32)
+                if (filefmt == kpse_tex_format ||
+                    filefmt == kpse_bib_format) {
+                    *f_ptr = nkf_open (fname, fopen_mode);
+                } else
+#endif
+                *f_ptr = xfopen (fname, fopen_mode);
+
                 /* kpse_find_file always returns a new string. */
+#if defined(PTEX) && !defined(WIN32)
+                fname0 = ptenc_from_utf8_string_to_internal_enc(fname);
+                if (fname0) {
+                    free (fname);
+                    fname = fname0;
+                }
+#endif
                 free (nameoffile);
                 namelength = strlen (fname);
                 nameoffile = xmalloc (namelength + 2);
                 strcpy (nameoffile + 1, fname);
                 free (fname);
-
-                /* This fopen is not allowed to fail. */
-#if defined(PTEX) && !defined(WIN32)
-                if (filefmt == kpse_tex_format ||
-                    filefmt == kpse_bib_format) {
-                    *f_ptr = nkf_open (nameoffile + 1, fopen_mode);
-                } else
-#endif
-                *f_ptr = xfopen (nameoffile + 1, fopen_mode);
             }
         }
     }
@@ -268,7 +297,37 @@
 
     return *f_ptr != NULL;
 }
+
 

+/* Open input file *F_PTR (of type FILEFMT), prepending the directory
+   part of the string FNAME to `nameoffile'+1, unless that is already
+   kpse_absolute_p. This is called from BibTeX, to open subsidiary .aux
+   files, with FNAME set to the top-level aux file. The idea is that if
+   we're invoked as bibtex somedir/foo.aux, and foo.aux has an
+   \@input{bar} statement, we should look for somedir/bar.aux too. (See
+   bibtex-auxinclude.test.) */
+
+boolean
+open_input_with_dirname (FILE **f_ptr, int filefmt, const char *fname)
+{
+  boolean ret = false;
+  char *top_dir = xdirname (fname);
+
+  if (top_dir && *top_dir && !STREQ (top_dir, ".")
+      && !kpse_absolute_p (nameoffile+1, true)) {
+    char *newname = concat3 (top_dir, DIR_SEP_STRING, nameoffile+1);
+    free (nameoffile);
+    nameoffile = xmalloc (strlen (newname) + 2);
+    strcpy (nameoffile + 1, newname);
+    ret = open_input (f_ptr, filefmt, FOPEN_RBIN_MODE);
+    free (newname);
+  }
+
+  free (top_dir);
+  return ret;
+}
+
+

 /* Open an output file F either in the current directory or in
    $TEXMFOUTPUT/F, if the environment variable `TEXMFOUTPUT' exists.
    (Actually, this also applies to the BibTeX and MetaPost output files,
@@ -281,6 +340,9 @@
 open_output (FILE **f_ptr, const_string fopen_mode)
 {
     string fname;
+#if defined(PTEX) && !defined(WIN32)
+    string fname0;
+#endif
     boolean absolute = kpse_absolute_p(nameoffile+1, false);
 
     /* If we have an explicit output directory, use it. */
@@ -289,6 +351,13 @@
     } else {
         fname = nameoffile + 1;
     }
+#if defined(PTEX) && !defined(WIN32)
+    fname0 = ptenc_from_internal_enc_string_to_utf8(fname);
+    if (fname0) {
+        if (fname != nameoffile + 1) free(fname);
+        fname = fname0;
+    }
+#endif
 
     /* Is the filename openable as given?  */
     *f_ptr = fopen (fname, fopen_mode);
@@ -307,6 +376,13 @@
     /* If this succeeded, change nameoffile accordingly.  */
     if (*f_ptr) {
         if (fname != nameoffile + 1) {
+#if defined(PTEX) && !defined(WIN32)
+            fname0 = ptenc_from_utf8_string_to_internal_enc(fname);
+            if (fname0) {
+                free(fname);
+                fname = fname0;
+            }
+#endif
             free (nameoffile);
             namelength = strlen (fname);
             nameoffile = xmalloc (namelength + 2);

Modified: branches/stable/source/src/texk/web2c/lib/texmfmp.c
===================================================================
--- branches/stable/source/src/texk/web2c/lib/texmfmp.c	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/texk/web2c/lib/texmfmp.c	2018-07-10 17:26:48 UTC (rev 806)
@@ -710,11 +710,14 @@
   enc = kpse_var_value("command_line_encoding");
   get_command_line_args_utf8(enc, &argc, &argv);
 #endif
+#if IS_pTeX && !IS_upTeX && !defined(WIN32)
+  ptenc_get_command_line_args(&argc, &argv);
+#endif
 
   /* If the user says --help or --version, we need to notice early.  And
      since we want the --ini option, have to do it before getting into
      the web (which would read the base file, etc.).  */
-#if (IS_upTeX || defined(XeTeX) || defined(pdfTeX)) && defined(WIN32)
+#if ((IS_upTeX || defined(XeTeX) || defined(pdfTeX)) && defined(WIN32)) || (IS_pTeX && !IS_upTeX && !defined(WIN32))
   parse_options (argc, argv);
 #else
   parse_options (ac, av);
@@ -1386,7 +1389,7 @@
 {
   wchar_t *wpath;
   int     ret;
-  wpath = get_wstring_from_mbstring(kpse_def->File_system_codepage,
+  wpath = get_wstring_from_mbstring(file_system_codepage,
           path, wpath = NULL);
   ret = _wstat(wpath, buffer);
   free(wpath);
@@ -1660,7 +1663,6 @@
 #endif /* TeX or MF */
 #if IS_pTeX
 #ifdef WIN32
-      { "sjis-terminal",             0, &sjisterminal, 1 },
       { "guess-input-enc",           0, &infile_enc_auto, 1 },
       { "no-guess-input-enc",        0, &infile_enc_auto, 0 },
 #endif

Modified: branches/stable/source/src/texk/web2c/man/Makefile.in
===================================================================
--- branches/stable/source/src/texk/web2c/man/Makefile.in	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/texk/web2c/man/Makefile.in	2018-07-10 17:26:48 UTC (rev 806)
@@ -97,13 +97,15 @@
 @ETEX_TRUE at am__append_8 = etex.man
 @PDFTEX_TRUE at am__append_9 = $(pdftex_man_sources)
 @PDFTEX_TRUE at am__append_10 = pdftex:pdflatex
- at LUATEX_TRUE@am__append_11 = luatex.man
- at LUATEX_TRUE@am__append_12 = luatex:texlua luatex:texluac
- at XETEX_TRUE@am__append_13 = # xetex.man
- at OTANGLE_TRUE@am__append_14 = $(otangle_man_sources)
- at OTANGLE_TRUE@am__append_15 = dvicopy:odvicopy dvitype:odvitype tangle:otangle
- at ALEPH_TRUE@am__append_16 = aleph.man
- at ALEPH_TRUE@am__append_17 = aleph:lamed
+ at PTEX_TRUE@am__append_11 = ptex.man
+ at PTEX_TRUE@am__append_12 = ptex:eptex ptex:euptex ptex:uptex
+ at LUATEX_TRUE@am__append_13 = luatex.man
+ at LUATEX_TRUE@am__append_14 = luatex:texlua luatex:texluac
+ at XETEX_TRUE@am__append_15 = xetex.man
+ at OTANGLE_TRUE@am__append_16 = $(otangle_man_sources)
+ at OTANGLE_TRUE@am__append_17 = dvicopy:odvicopy dvitype:odvitype tangle:otangle
+ at ALEPH_TRUE@am__append_18 = aleph.man
+ at ALEPH_TRUE@am__append_19 = aleph:lamed
 subdir = man
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/web2c-disable.m4 \
@@ -440,16 +442,18 @@
 man_sources = $(bootstrap_man_sources) $(am__append_1) $(am__append_2) \
 	$(am__append_4) $(am__append_7) $(am__append_8) \
 	$(am__append_9) $(am__append_11) $(am__append_13) \
-	$(am__append_14) $(am__append_16) $(misc_man_sources)
+	$(am__append_15) $(am__append_16) $(am__append_18) \
+	$(misc_man_sources)
 EXTRA_DIST = $(bootstrap_man_sources) $(web_man_sources) tex.man \
-	mf.man mpost.man etex.man $(pdftex_man_sources) luatex.man \
-	$(otangle_man_sources) aleph.man $(misc_man_sources) spell.add
+	mf.man mpost.man etex.man $(pdftex_man_sources) ptex.man \
+	luatex.man xetex.man $(otangle_man_sources) aleph.man \
+	$(misc_man_sources) spell.add
 bootstrap_man_sources = ctie.man cweb.man tangle.man tie.man
 
 # Symlinks within $(man1dir): FILE:LINK indicates LINK.1->FILE.1
 man1_links = cweb:ctangle cweb:cweave $(am__append_3) $(am__append_5) \
 	$(am__append_6) $(am__append_10) $(am__append_12) \
-	$(am__append_15) $(am__append_17)
+	$(am__append_14) $(am__append_17) $(am__append_19)
 web_man_sources = bibtex.man dvicopy.man dvitomp.man dvitype.man gftodvi.man \
 	gftopk.man gftype.man mft.man patgen.man pktogf.man pktype.man \
 	pltotf.man pooltype.man tftopl.man vftovp.man vptovf.man weave.man

Modified: branches/stable/source/src/texk/web2c/pdftexdir/ChangeLog
===================================================================
--- branches/stable/source/src/texk/web2c/pdftexdir/ChangeLog	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/texk/web2c/pdftexdir/ChangeLog	2018-07-10 17:26:48 UTC (rev 806)
@@ -1,3 +1,37 @@
+2018-07-09  Karl Berry  <karl at freefriends.org>
+
+	* writefont.c (write_fontdescriptor) [ENABLE_PDF_CHARSET]:
+
+2018-06-13  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
+
+	* ptexlib.h: Output correct Unicode strings on console
+	(w32 only).
+
+2018-06-12  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
+
+	* pdftoepdf.cc: Free unused memory (w32 only).
+
+2018-06-11  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
+
+	* pdftoepdf.cc: Remove xfree(file_name) in order to avoid
+	to output garbage.
+	* pdftoepdf-newpoppler.cc: Remove _WIN32 changes, since
+	utf-8 names are transformed to Unicode and _wopened
+	in poppler.
+
+2018-06-10  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
+
+	* ptexlib.h, pdftoepdf.cc, pdftoepdf-newpoppler.cc:
+	Allow non-ascii file names for pdfTeX with UTF-8 source files
+	(w32 only). The function is enabled by setting
+	'command_line_encoding=utf-8' in texmf.cnf.
+
+2018-05-29  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
+
+	* ptexlib.h: Discard the changes on 2018-05-11, since
+	'command_line_encoding=utf-8' is not so natural for
+	pdfTeX (w32 only).
+
 2018-05-13  Joseph Wright  <joseph.wright at morningstar2.co.uk>
 
 	* pdftex.web: New primitive \expanded based on original
@@ -5,7 +39,6 @@
 	  Bruno Le Floch and David Carlisle (on behalf of The LaTeX Project).
         (expanded_code): new @d, new cases.
         https://mailman.ntg.nl/pipermail/ntg-pdftex/2018-May/004233.html
-        http://tug.org/pipermail/tex-live/2018-May/041599.html
 
 2018-05-11  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
 

Modified: branches/stable/source/src/texk/web2c/pdftexdir/pdftoepdf.cc
===================================================================
--- branches/stable/source/src/texk/web2c/pdftexdir/pdftoepdf.cc	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/texk/web2c/pdftexdir/pdftoepdf.cc	2018-07-10 17:26:48 UTC (rev 806)
@@ -166,6 +166,16 @@
 static PdfDocument *find_add_document(char *file_name)
 {
     PdfDocument *p = pdfDocuments;
+#ifdef _WIN32
+    int file_name_is_changed = 0;
+    wchar_t *fnamew;
+    if (file_system_codepage == CP_UTF8 && win32_codepage != CP_UTF8) {
+        fnamew = get_wstring_from_mbstring(CP_UTF8, file_name, fnamew=NULL);
+        file_name = get_mbstring_from_wstring(win32_codepage, fnamew, file_name=NULL);
+        file_name_is_changed = 1;
+        xfree(fnamew);
+    }
+#endif
     while (p && strcmp(p->file_name, file_name) != 0)
         p = p->next;
     if (p) {
@@ -185,6 +195,10 @@
     p->inObjList = 0;
     p->next = pdfDocuments;
     pdfDocuments = p;
+#ifdef _WIN32
+    if (file_name_is_changed == 1)
+        xfree(file_name);
+#endif
     return p;
 }
 

Modified: branches/stable/source/src/texk/web2c/pdftexdir/ptexlib.h
===================================================================
--- branches/stable/source/src/texk/web2c/pdftexdir/ptexlib.h	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/texk/web2c/pdftexdir/ptexlib.h	2018-07-10 17:26:48 UTC (rev 806)
@@ -23,8 +23,12 @@
 #ifdef _WIN32
 #undef fopen
 #undef xfopen
+#undef fputs
+#undef putc
 #define fopen fsyscp_fopen
 #define xfopen fsyscp_xfopen
+#define fputs win32_fputs
+#define putc win32_putc
 #endif
 
 /* WEB2C macros and prototypes */

Modified: branches/stable/source/src/texk/web2c/pdftexdir/writefont.c
===================================================================
--- branches/stable/source/src/texk/web2c/pdftexdir/writefont.c	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/texk/web2c/pdftexdir/writefont.c	2018-07-10 17:26:48 UTC (rev 806)
@@ -484,10 +484,19 @@
     pdf_printf("/Flags %i\n", fd_flags);
     write_fontmetrics(fd);
     if (fd->ff_found) {
+#ifdef ENABLE_PDF_CHARSET /* just in case a builder wants it */
         if (is_subsetted(fd->fm) && is_type1(fd->fm)) {
-            /* /CharSet is optional; names may appear in any order */
+            /* CharSet is optional, but if it appears, it must be
+               correct. Unfortunately, there is no practical way we can
+               guarantee correctness with precomposed accent characters
+               in our usual fonts (EC, TX, etc.):
+              https://mailman.ntg.nl/pipermail/ntg-pdftex/2018-June/004251.html
+               Therefore, we disable its output. The code is left in
+               just in case it turns out that something important was
+               relying on the (incorrect) CharSet. */
             assert(fd->gl_tree != NULL);
             avl_t_init(&t, fd->gl_tree);
+            /* Names may appear in any order. */
             pdf_puts("/CharSet (");
             for (glyph = (char *) avl_t_first(&t, fd->gl_tree); glyph != NULL;
                  glyph = (char *) avl_t_next(&t))
@@ -494,6 +503,7 @@
                 pdf_printf("/%s", glyph);
             pdf_puts(")\n");
         }
+#endif /* ENABLE_PDF_CHARSET */
         if (is_type1(fd->fm))
             pdf_printf("/FontFile %i 0 R\n", (int) fd->ff_objnum);
         else if (is_truetype(fd->fm))

Modified: branches/stable/source/src/texk/web2c/synctexdir/ChangeLog
===================================================================
--- branches/stable/source/src/texk/web2c/synctexdir/ChangeLog	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/texk/web2c/synctexdir/ChangeLog	2018-07-10 17:26:48 UTC (rev 806)
@@ -1,3 +1,19 @@
+2018-06-13  Karl Berry  <karl at tug.org>
+
+	* man1/synctex.1: man page list syntax.
+	Report/patch from esr, 12 Jun 2018 15:16:13.
+
+2018-06-10  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
+
+	* synctex.c: Allow non-ascii file names for pdfTeX
+	with UTF-8 source files (w32 only).
+
+2018-05-29  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
+
+	* synctex.c: Discard the changes on 2018-05-11, since
+	'command_line_encoding=utf-8' is not so natural for
+	pdfTeX (w32 only).
+
 2018-05-11  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
 
 	* synctex.c: Allow non-ascii file names also for pdfTeX

Modified: branches/stable/source/src/texk/web2c/synctexdir/man1/synctex.1
===================================================================
--- branches/stable/source/src/texk/web2c/synctexdir/man1/synctex.1	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/texk/web2c/synctexdir/man1/synctex.1	2018-07-10 17:26:48 UTC (rev 806)
@@ -1,8 +1,8 @@
-.Dd 04/23/2017     \" DATE
+.Dd 06/13/2018     \" DATE
 .Dt synctex 1      \" Program name and manual section number 
 .Sh NAME
 .Nm synctex
-.Nd command line client tool to support the Synchronize TeXnology available in recent TeX engines.
+.Nd command line client tool to support the Synchronize TeXnology available in most TeX engines.
 .Sh SYNOPSIS
 .Nm
 \fIcommand\fP [\fIoptions\fP] [\fIargs\fP]
@@ -14,18 +14,20 @@
 .Pp
 Run `synctex help' to access the built-in tool documentation.
 .Sh TEX ENGINE OPTION -synctex=NUMBER
+.Bl -bullet
 .It
-.Li If NUMBER=0 or no option is given, no synctex file is created.
+If NUMBER=0 or no option is given, no synctex file is created.
 .It
-.Li If NUMBER<0, synctex files are text files.
+If NUMBER<0, synctex files are text files.
 .It
-.Li If NUMBER>0, synctex files are compressed with gz.
+If NUMBER>0, synctex files are compressed with gz.
 .It
-.Li If NUMBER&2, no .gz extension is used.
+If NUMBER&2, no .gz extension is used.
 .It
-.Li If NUMBER&4, activate form support, useful for pdftex.
+If NUMBER&4, activate form support, useful for pdftex.
 .It
-.Li If NUMBER&8, better file compression.
+If NUMBER&8, better file compression.
+.El
 .Pp
 Use for example `pdftex -synctex=15 foo.tex' to activate all the options.
 .Pp

Added: branches/stable/source/src/texk/web2c/tests/auxinclude.bbl
===================================================================
--- branches/stable/source/src/texk/web2c/tests/auxinclude.bbl	                        (rev 0)
+++ branches/stable/source/src/texk/web2c/tests/auxinclude.bbl	2018-07-10 17:26:48 UTC (rev 806)
@@ -0,0 +1,16 @@
+\newcommand{\noopsort}[1]{} \newcommand{\printfirst}[2]{#1}
+  \newcommand{\singleletter}[1]{#1} \newcommand{\switchargs}[2]{#2#1}
+\begin{thebibliography}{}
+
+\bibitem[Aamport, 1986]{article-minimal}
+Aamport, L.~A. (1986).
+\newblock The gnats and gnus document preparation system.
+\newblock {\em \mbox{G-Animal's} Journal}.
+
+\bibitem[GAJ, 1986]{whole-journal}
+GAJ (1986).
+\newblock {\em \mbox{G-Animal's} Journal}, 41(7).
+\newblock The entire issue is devoted to gnats and gnus (this entry is a
+  cross-referenced ARTICLE (journal)).
+
+\end{thebibliography}


Property changes on: branches/stable/source/src/texk/web2c/tests/auxinclude.bbl
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: branches/stable/source/src/texk/web2c/tests/auxinclude.bib
===================================================================
--- branches/stable/source/src/texk/web2c/tests/auxinclude.bib	                        (rev 0)
+++ branches/stable/source/src/texk/web2c/tests/auxinclude.bib	2018-07-10 17:26:48 UTC (rev 806)
@@ -0,0 +1,6 @@
+% $Id: auxinclude.bib 47979 2018-06-10 22:13:16Z karl $
+% Bibliography test file for bibtex-auxinclude.test (q.v.).
+% Public domain. Originally written 2018, Karl Berry.
+
+ at misc{rmain, title="r-main", author="R. Main"}
+ at misc{rsub, title="r-sub", author="R. Sub"}


Property changes on: branches/stable/source/src/texk/web2c/tests/auxinclude.bib
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: branches/stable/source/src/texk/web2c/tests/auxinclude.blg
===================================================================
--- branches/stable/source/src/texk/web2c/tests/auxinclude.blg	                        (rev 0)
+++ branches/stable/source/src/texk/web2c/tests/auxinclude.blg	2018-07-10 17:26:48 UTC (rev 806)
@@ -0,0 +1,52 @@
+This is BibTeX, Version 0.99d (TeX Live 2019/dev)
+Capacity: max_strings=100000, hash_size=100000, hash_prime=85009
+The top-level auxiliary file: /r/tug/home/texlive/karl/Build/source/texk/web2c/tests/auxinclude.aux
+I couldn't open auxiliary file /r/tug/home/texlive/karl/Build/source/texk/web2c/tests/xauxinclude2.aux
+---line 3 of file /r/tug/home/texlive/karl/Build/source/texk/web2c/tests/auxinclude.aux
+ : \@input{/r/tug/home/texlive/karl/Build/source/texk/web2c/tests/xauxinclude2.aux
+ :                                                                                }
+I'm skipping whatever remains of this command
+The style file: apalike.bst
+Database file #1: xampl.bib
+You've used 1 entry,
+            1935 wiz_defined-function locations,
+            484 strings with 4212 characters,
+and the built_in function-call counts, 293 in all, are:
+= -- 26
+> -- 7
+< -- 1
++ -- 4
+- -- 2
+* -- 17
+:= -- 59
+add.period$ -- 3
+call.type$ -- 1
+change.case$ -- 6
+chr.to.int$ -- 1
+cite$ -- 1
+duplicate$ -- 13
+empty$ -- 21
+format.name$ -- 3
+if$ -- 52
+int.to.chr$ -- 1
+int.to.str$ -- 0
+missing$ -- 1
+newline$ -- 9
+num.names$ -- 3
+pop$ -- 5
+preamble$ -- 2
+purify$ -- 6
+quote$ -- 0
+skip$ -- 11
+stack$ -- 0
+substring$ -- 14
+swap$ -- 1
+text.length$ -- 0
+text.prefix$ -- 0
+top$ -- 0
+type$ -- 6
+warning$ -- 0
+while$ -- 2
+width$ -- 0
+write$ -- 15
+(There was 1 error message)


Property changes on: branches/stable/source/src/texk/web2c/tests/auxinclude.blg
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: branches/stable/source/src/texk/web2c/tests/auxinclude.pdf
===================================================================
(Binary files differ)

Index: branches/stable/source/src/texk/web2c/tests/auxinclude.pdf
===================================================================
--- branches/stable/source/src/texk/web2c/tests/auxinclude.pdf	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/texk/web2c/tests/auxinclude.pdf	2018-07-10 17:26:48 UTC (rev 806)

Property changes on: branches/stable/source/src/texk/web2c/tests/auxinclude.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: branches/stable/source/src/texk/web2c/tests/auxinclude.tex
===================================================================
--- branches/stable/source/src/texk/web2c/tests/auxinclude.tex	                        (rev 0)
+++ branches/stable/source/src/texk/web2c/tests/auxinclude.tex	2018-07-10 17:26:48 UTC (rev 806)
@@ -0,0 +1,13 @@
+% $Id: auxinclude.tex 47979 2018-06-10 22:13:16Z karl $
+% Top-level test file for bibtex-auxinclude.test (q.v.).
+% Public domain. Originally written 2018, Karl Berry.
+% built with the usual: latex auxinclude && bibtex auxinclude &&
+%   latex auxinclude && latex auxinclude
+% (although we don't use the normal output, just the .aux/bib files).
+\documentclass{article}
+\begin{document}
+article-minimal from main file: \cite{article-minimal}. Including subfile:
+\include{auxinclude2}
+\bibliographystyle{apalike}% just because we already have it in web2c/tests
+\bibliography{xampl}
+\end{document}


Property changes on: branches/stable/source/src/texk/web2c/tests/auxinclude.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: branches/stable/source/src/texk/web2c/tests/auxinclude2.tex
===================================================================
--- branches/stable/source/src/texk/web2c/tests/auxinclude2.tex	                        (rev 0)
+++ branches/stable/source/src/texk/web2c/tests/auxinclude2.tex	2018-07-10 17:26:48 UTC (rev 806)
@@ -0,0 +1,4 @@
+% $Id: auxinclude2.tex 47979 2018-06-10 22:13:16Z karl $
+% Subsidiary (\include-d) test file for bibtex-auxinclude.test (q.v.).
+% Public domain. Originally written 2018, Karl Berry.
+whole-journal from included file: \cite{whole-journal}.


Property changes on: branches/stable/source/src/texk/web2c/tests/auxinclude2.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: branches/stable/source/src/texk/web2c/tests/bibtex-auxinclude.test
===================================================================
--- branches/stable/source/src/texk/web2c/tests/bibtex-auxinclude.test	                        (rev 0)
+++ branches/stable/source/src/texk/web2c/tests/bibtex-auxinclude.test	2018-07-10 17:26:48 UTC (rev 806)
@@ -0,0 +1,22 @@
+#! /bin/sh -vx
+# $Id: bibtex-auxinclude.test 47980 2018-06-10 22:25:18Z karl $
+# Copyright 2018 Karl Berry <tex-live at tug.org>
+# You may freely use, modify and/or distribute this file.
+
+test -d tests || mkdir -p tests
+
+# in case we're invoked standalone instead of from make.
+test -z "$srcdir" && srcdir=`cd \`dirname $0\`/.. && pwd`
+
+cp $srcdir/tests/auxinclude.aux tests/xauxinclude.aux || exit 1
+cp $srcdir/tests/auxinclude2.aux tests/auxinclude2.aux || exit 1
+
+# [x]auxinclude.aux includes \@input{auxinclude2.aux}, to be found in
+# the ./tests/ (working) subdir, which should be automatically checked
+# since we invoke bibtex on tests/whatever.aux. See thread from
+# http://tug.org/pipermail/tex-live/2018-May/041624.html.
+# 
+TEXMFCNF=$srcdir/../kpathsea \
+  BSTINPUTS=$srcdir/tests \
+  BIBINPUTS=$srcdir/tests \
+  ./bibtex tests/xauxinclude || exit 1


Property changes on: branches/stable/source/src/texk/web2c/tests/bibtex-auxinclude.test
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Modified: branches/stable/source/src/texk/web2c/texmfmp-help.h
===================================================================
--- branches/stable/source/src/texk/web2c/texmfmp-help.h	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/texk/web2c/texmfmp-help.h	2018-07-10 17:26:48 UTC (rev 806)
@@ -124,9 +124,6 @@
     "-recorder               enable filename recorder",
     "[-no]-shell-escape      disable/enable \\write18{SHELL COMMAND}",
     "-shell-restricted       enable restricted \\write18",
-#if defined(WIN32)
-    "-sjis-terminal          always output to stdout and stderr by CP932",
-#endif
     "-src-specials           insert source specials into the DVI file",
     "-src-specials=WHERE     insert source specials in certain places of",
     "                          the DVI file. WHERE is a comma-separated value",
@@ -254,9 +251,6 @@
     "-recorder               enable filename recorder",
     "[-no]-shell-escape      disable/enable \\write18{SHELL COMMAND}",
     "-shell-restricted       enable restricted \\write18",
-#if defined(WIN32)
-    "-sjis-terminal          always output to stdout and stderr by CP932",
-#endif
     "-src-specials           insert source specials into the DVI file",
     "-src-specials=WHERE     insert source specials in certain places of",
     "                          the DVI file. WHERE is a comma-separated value",
@@ -523,9 +517,6 @@
     "-recorder               enable filename recorder",
     "[-no]-shell-escape      disable/enable \\write18{SHELL COMMAND}",
     "-shell-restricted       enable restricted \\write18",
-#if defined(WIN32)
-    "-sjis-terminal          always output to stdout and stderr by CP932",
-#endif
     "-src-specials           insert source specials into the DVI file",
     "-src-specials=WHERE     insert source specials in certain places of",
     "                          the DVI file. WHERE is a comma-separated value",
@@ -651,9 +642,6 @@
     "-recorder               enable filename recorder",
     "[-no]-shell-escape      disable/enable \\write18{SHELL COMMAND}",
     "-shell-restricted       enable restricted \\write18",
-#if defined(WIN32)
-    "-sjis-terminal          always output to stdout and stderr by CP932",
-#endif
     "-src-specials           insert source specials into the DVI file",
     "-src-specials=WHERE     insert source specials in certain places of",
     "                          the DVI file. WHERE is a comma-separated value",

Modified: branches/stable/source/src/texk/web2c/web2c/ChangeLog
===================================================================
--- branches/stable/source/src/texk/web2c/web2c/ChangeLog	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/texk/web2c/web2c/ChangeLog	2018-07-10 17:26:48 UTC (rev 806)
@@ -1,3 +1,7 @@
+2018-06-08  Karl Berry  <karl at freefriends.org>
+
+	* common.defines (aopeninwithdirname): add.
+
 2016-04-06  Karl Berry  <karl at tug.org>
 
 	* convert: remove $pascalfile if it is empty,

Modified: branches/stable/source/src/texk/web2c/web2c/common.defines
===================================================================
--- branches/stable/source/src/texk/web2c/web2c/common.defines	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/texk/web2c/web2c/common.defines	2018-07-10 17:26:48 UTC (rev 806)
@@ -97,6 +97,7 @@
 @define function abs ();
 @define function addressof ();
 @define function aopenin ();
+ at define function aopeninwithdirname ();
 @define function aopenout ();
 @define function atof ();
 @define function atoi ();

Modified: branches/stable/source/src/utils/README
===================================================================
--- branches/stable/source/src/utils/README	2018-07-10 16:45:03 UTC (rev 805)
+++ branches/stable/source/src/utils/README	2018-07-10 17:26:48 UTC (rev 806)
@@ -1,4 +1,4 @@
-$Id: README 47714 2018-05-14 18:07:32Z karl $
+$Id: README 48168 2018-07-09 17:00:10Z karl $
 Public domain.  Originally written 2005 by Karl Berry.
 
 Extra utilities we (optionally) compile for TeX Live.
@@ -39,9 +39,9 @@
 
 xindy - see just below
 
-xpdfopen 0.86 - checked 24may14
+xpdfopen 0.86 - checked 9jul18
   http://ctan.org/pkg/xpdfopen/
-  http://cs.acadiau.ca/~jdiamond/xpdfopen/
+  http://cs.acadiau.ca/~jdiamond/xpdfopen/ (404; no reply from author, 9jul18)
 
 

 xindy 2.5.1 - checked 15sep14



More information about the pdftex-commits mailing list