diff options
author | Karl Berry <karl@freefriends.org> | 2020-01-19 17:04:02 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-01-19 17:04:02 +0000 |
commit | eeb7eab0a55e0bb85518b0fed6776c40cca8df80 (patch) | |
tree | 44b689f7d705d0d8ddbd16f6339d7c841d9d25e8 /Build/source/texk/kpathsea/tests/cnfnull.test | |
parent | 8a8104081ac2b2038544981a21b6e6dd69602ebb (diff) |
drop NUL (zero) bytes in texmf.cnf and other files read by kpse
git-svn-id: svn://tug.org/texlive/trunk@53454 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/kpathsea/tests/cnfnull.test')
-rwxr-xr-x | Build/source/texk/kpathsea/tests/cnfnull.test | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Build/source/texk/kpathsea/tests/cnfnull.test b/Build/source/texk/kpathsea/tests/cnfnull.test new file mode 100755 index 00000000000..e80d931394c --- /dev/null +++ b/Build/source/texk/kpathsea/tests/cnfnull.test @@ -0,0 +1,23 @@ +#!/bin/sh -vx +# $Id$ +# Copyright 2020 Karl Berry <tex-live@tug.org> +# You may freely use, modify and/or distribute this file. +# +# Test nul (zero) bytes in texmf.cnf. + +cnf_dir=cnfnull +cnf_file=$cnf_dir/texmf.cnf + +# Create the texmf.cnf dynamically so we don't have to check in a file +# containing nul bytes. +rm -rf $cnf_dir +mkdir $cnf_dir +test -d $cnf_dir || exit 1 +printf 'x\0=1\n\0' >$cnf_file || exit 1 + +val=`./kpsewhich "--cnf-line=TEXMFCNF=$cnf_dir" --var-value=x` +test x"$val" = x1 || exit 1 + +# Before we dropped nul bytes in 2020, kpse gave a warning: +# warning: cnfnull/texmf.cnf:1: (kpathsea) No cnf value on line: x. +# and did not assign anything (since the string ended with the x). |