delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/29/03:53:06

Date: Thu, 29 May 1997 10:51:08 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Esa A E Peuha <peuha AT cc DOT helsinki DOT fi>
cc: djgpp AT delorie DOT com, DJ Delorie <dj AT delorie DOT com>
Subject: Re: Bug in Less 3.21
In-Reply-To: <5mgu93$6$1@oravannahka.Helsinki.FI>
Message-ID: <Pine.SUN.3.91.970529105019.17046F-100000@is>
MIME-Version: 1.0

On 28 May 1997, Esa A E Peuha wrote:

> Less version 3.21 doesn't handle the environment variable LESSBINFMT
> correctly: the actual character code and everything after it are not printed.
> With the DJGPP.ENV setting, it just prints `<'.

This bug was lying around for almost two years, so thanks for
reporting it.  However, it has nothing to do with Less, it's just that
the stock DJGPP.ENV from v2 distribution incorrectly defines
LESSBINFMT.  The problem is that the percent sign `%' is special to
the DJGPP.ENV syntax, so if you need a literal `%', you should put two
of them in a row.  The simple patch below will make Less correctly
display binary characters.  

Note that LESSCHARDEF is defined so that the only character which
needs LESSBINFMT is 0xff (which probably explains why this bug went
undetected until now).  This is so you could browse files which
include national (non-US) characters typically burned into the BIOS
with ASCII codes above 128 and see these characters with their true
glyphs (and without being annoyed by the message from Less telling you
this might be a binary file).

Incidentally, the documentation doesn't say that you need two `%'s to
get it literally (I looked into the sources to see what's going on),
so the patch below also corrects the docs, for those who care.

*** djgpp.e~0	Sat Oct  5 23:02:28 1996
--- djgpp.env	Wed May 28 22:43:04 1997
***************
*** 31,37 ****
  INFOPATH=%/>;INFOPATH%%DJDIR%/info;%DJDIR%/gnu/emacs/info
  
  [less]
! LESSBINFMT=*k<%X>
  LESSCHARDEF=8bcccbcc12bc5b95.b127.b
  LESS=%LESS% -h5$y5$Dd2.0$Du14.0$Ds4.7$Dk9.0$
  
--- 31,37 ----
  INFOPATH=%/>;INFOPATH%%DJDIR%/info;%DJDIR%/gnu/emacs/info
  
  [less]
! LESSBINFMT=*k<%%X>
  LESSCHARDEF=8bcccbcc12bc5b95.b127.b
  LESS=%LESS% -h5$y5$Dd2.0$Du14.0$Ds4.7$Dk9.0$
  
*** src/docs/kb/djgppenv.t~0	Sun Apr 28 00:39:16 1996
--- src/docs/kb/djgppenv.txi	Wed May 28 22:41:38 1997
***************
*** 45,47 ****
--- 45,56 ----
  in which case the DOS environment overrides the file (the `+' is
  removed from the name), as in `+USER=dosuser'.
  
+ If you need a literal `%', write two percent signs in a row, like so:
+ 
+ @example
+ LESSBINFMT=*k<%%X>
+ @end example
+ 
+ This will produce a value of @samp{*k<%X>} for the variable
+ @code{LESSBINFMT}.
+ 

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019