Discussion:
bug#29648: BUG in zless and similar scripts?
Michele Venturi
2017-12-10 09:26:32 UTC
Permalink
As you can see here: https://pastebin.com/Q7fcrYhp
there is an error in the parameters expansion syntax.

It should be "${LESSMETACHARS:+set}" and not just
"${LESSMETACHARS+set}". zdiff, zgrep and zmore
miss a colon in the source code in the same way.
--
http://profiles.google.com/dardo82
Paul Eggert
2017-12-13 00:58:26 UTC
Permalink
As you can see here:https://pastebin.com/Q7fcrYhp
there is an error in the parameters expansion syntax.
It should be "${LESSMETACHARS:+set}" and not just
"${LESSMETACHARS+set}". zdiff, zgrep and zmore
miss a colon in the source code in the same way.
Why is this a bug? I don't see the problem. Can you give an example of
misbehavior because of the bug?

Perhaps the simplest fix for the bug, once we know what it is, would be
to remove the workaround for less 394 and earlier, as I doubt whether
anyone would combine a 'less' that old with new 'gzip'.
Vidar Holen
2017-12-13 01:50:12 UTC
Permalink
${var:+value} and ${var+value} differ in how they handle the case when
var="" (i.e. defined, and assigned the empty string).

In this case, the check verifies that LESSMETACHARS is set (even if it's
set to the empty string), so it seems correct as is.
Post by Paul Eggert
As you can see here:https://pastebin.com/Q7fcrYhp
there is an error in the parameters expansion syntax.
It should be "${LESSMETACHARS:+set}" and not just
"${LESSMETACHARS+set}". zdiff, zgrep and zmore
miss a colon in the source code in the same way.
Why is this a bug? I don't see the problem. Can you give an example of
misbehavior because of the bug?
Perhaps the simplest fix for the bug, once we know what it is, would be to
remove the workaround for less 394 and earlier, as I doubt whether anyone
would combine a 'less' that old with new 'gzip'.
Loading...