unexpand -t4 converts too much whitespace to tabs

"Charles Karney" <[email protected]> Sat, 19 Jul 2003 09:44:00 -0400
Newsgroups gmane.comp.gnu.textutils.bugs
Message-ID <[email protected]>
Problem
  The documentation for unexpand claims
    * that only initial whitespace is converted (unless -a is given)
    * that only sequences of 2 or more spaces are converted

  Neither of these is true for nondefault tab settings.

Configuration
  unexpand (textutils) 2.0.21
  RedHat Linux 8.0
  RPM textutils-2.0.21-5

Repeat with...

  Interior white space is converted in this example
    $ echo 'a   b'  | unexpand -t4    | tr '\t' X
    aXb

  A single space is converted in this example
    $ echo 'aaa  b' | unexpand -t4 -a | tr '\t' X
    aaaX b

-- 
Charles Karney                  Email:  [email protected]
Sarnoff Corporation             Phone:  +1 609 734 2312
Princeton, NJ 08543-5300        Fax:    +1 609 734 2323