]> git.ipfire.org Git - thirdparty/coreutils.git/commit
unexpand: fix misalignment when spaces span a tabstop
authorPádraig Brady <P@draigBrady.com>
Tue, 19 Jul 2011 08:06:37 +0000 (09:06 +0100)
committerPádraig Brady <P@draigBrady.com>
Wed, 20 Jul 2011 09:38:46 +0000 (10:38 +0100)
commit65a0483fb55bd2b4dab305af8a95cd25e292142b
treeb3659380054dbe0bc0f627a3d06cedb42f0736b4
parentdc7284ef722b64569b1cb48df6b6c2d3fcd8b9a8
unexpand: fix misalignment when spaces span a tabstop

The following dropped the space from the first field
  printf "1234567  \t1\n" | unexpand -a
Note POSIX says that spaces should not precede tabs.
Also a single trailing space should not be converted
if the next field starts with non blank characters.
So we enforce those rules too, with this change.

* src/unexpand.c (unexpand): Implement as per POSIX rules.
* tests/misc/unexpand: Add tests, and adjust existing
tests as per POSIX rules.
* NEWS: Mention the fix.
Reported by Hallvard B Furuseth
NEWS
src/unexpand.c
tests/misc/unexpand