Package: less
Version: 382-1

In fixing Debian bug <http://bugs.debian.org/383358> I discovered that
the underlying problem was in 'less', not in gzip itself.  The problem
is that by default 'less' does not think that '$' is a shell
metacharacter.

Here's how to reproduce the problem:

   $ echo huhuhu >t\$t.txt
   $ gzip t\$t.txt
   $ LESSOPEN="|gzip -cdfq -- %s"; export LESSOPEN
   $ less t\$t.txt.gz

The output will be:

   gzip: t.txt.gz: No such file or directory
   "t$t.txt.gz" may be a binary file.  See it anyway?

whereas it should output a screen saying "huhuhu".

I looked at the POSIX spec
<http://www.opengroup.org/susv3/utilities/xcu_chap02.html#tag_02_02>
and it says that =, %, and ~ are metacharacters in some cases, so to
be safe these should be quoted too.

Here is a proposed patch, relative to less 394:

--- configure.ac-394    2005-10-21 09:21:55.000000000 -0700
+++ configure.ac        2006-12-29 20:10:54.000000000 -0800
@@ -561,7 +561,7 @@ AH_TOP([
 /*
  * Default shell metacharacters and meta-escape character.
  */
-#define        DEF_METACHARS   "; *?\t\n'\"()<>[]|&^`#\\"
+#define        DEF_METACHARS   "; *?\t\n'\"()<>[]|&^`#\\$%=~"
 #define        DEF_METAESCAPE  "\\"
 
 /* 


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to