summaryrefslogtreecommitdiffstats
path: root/src/tests/mandb-empty-page
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:37:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:37:10 +0000
commitc9addba5cc770d2d231b34f6739f32c6be8690f1 (patch)
treec643da154a95a1d163137135050bb47858a1654e /src/tests/mandb-empty-page
parentInitial commit. (diff)
downloadman-db-c9addba5cc770d2d231b34f6739f32c6be8690f1.tar.xz
man-db-c9addba5cc770d2d231b34f6739f32c6be8690f1.zip
Adding upstream version 2.12.0.upstream/2.12.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tests/mandb-empty-page')
-rwxr-xr-xsrc/tests/mandb-empty-page28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/tests/mandb-empty-page b/src/tests/mandb-empty-page
new file mode 100755
index 0000000..66bdf74
--- /dev/null
+++ b/src/tests/mandb-empty-page
@@ -0,0 +1,28 @@
+#! /bin/sh
+
+# Test handling of empty files.
+# https://bugs.debian.org/622104
+
+: "${srcdir=.}"
+# shellcheck source-path=SCRIPTDIR
+. "$srcdir/testlib.sh"
+
+: "${MANDB=mandb}"
+
+init
+fake_config /usr/share/man /usr/X11R6/man
+MANPATH="$tmpdir/usr/share/man"
+export MANPATH
+
+mkdir -p "$tmpdir/usr/share/man/man1"
+touch "$tmpdir/usr/share/man/man1/empty.1"
+gzip -9 "$tmpdir/usr/share/man/man1/empty.1"
+run $MANDB -C "$tmpdir/manpath.config" -u -q "$tmpdir/usr/share/man"
+report 'empty page' "$?"
+
+./fspause
+ln -s empty.1.gz "$tmpdir/usr/share/man/man1/empty2.1.gz"
+run $MANDB -C "$tmpdir/manpath.config" -u -q "$tmpdir/usr/share/man"
+report 'symlink to empty page' "$?"
+
+finish