[xml/sgml-pkgs] Bug#1035554: libxml2-utils: xmllint ignores --output option and writes to stdout
Tj
debian at iam.tj
Fri May 5 11:51:05 BST 2023
Package: libxml2-utils
Version: 2.9.10+dfsg-6.7+deb11u4
Severity: normal
Tags: upstream
xmllint is ignoring --output FILE option. I've done a debug run with gdb and it correctly reads the option and assigns its value to the 'output' variable but doesn't read that variable before writing the output. Confirmed with gdb's hardware watch `awatch output`. The final trace before the output is written to stdout is:
3701 if (repeat) {
(gdb) n
3724 nbregister = 0;
(gdb) n
3727 if (stream != 0)
(gdb) n
3731 if (sax) {
(gdb) n
3734 parseAndPrintFile(argv[i], NULL);
$ xmllint --output test.txt --html --xpath '//div[contains(@class, '\''test'\'')]/div/ul/li/a/@href' xmllint-test.html
href="test0.html"
href="test1.html"
href="test2.html"
href="test3.html"
href="test4.html"
href="test5.html"
href="test6.html"
href="test7.html"
href="test8.html"
href="test9.html"
$ cat xmllint-test.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>xmllint test --output</title>
</head>
<body>
<h1>xmllint test --output</h1>
<div class="test">
<div>
<ul>
<li><a href="test0.html">test0</a></li>
<li><a href="test1.html">test1</a></li>
<li><a href="test2.html">test2</a></li>
<li><a href="test3.html">test3</a></li>
<li><a href="test4.html">test4</a></li>
<li><a href="test5.html">test5</a></li>
<li><a href="test6.html">test6</a></li>
<li><a href="test7.html">test7</a></li>
<li><a href="test8.html">test8</a></li>
<li><a href="test9.html">test9</a></li>
</ul>
</div>
</div>
</body>
</html>
-- System Information:
Debian Release: 11.7
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable-debug'), (500, 'proposed-updates-debug'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Versions of packages libxml2-utils depends on:
ii libc6 2.31-13+deb11u6
ii libxml2 2.9.10+dfsg-6.7+deb11u4
libxml2-utils recommends no packages.
libxml2-utils suggests no packages.
More information about the debian-xml-sgml-pkgs
mailing list