summaryrefslogtreecommitdiff
path: root/Build/source/texk/kpathsea/tests/cnfnull.test
blob: e80d931394c4192610f78c9224791209d04f9080 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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).