<feed xmlns='http://www.w3.org/2005/Atom'>
<title>coreutils/tests/ls, branch v7.3</title>
<subtitle>Mirror of https://https.git.savannah.gnu.org/git/coreutils.git/
</subtitle>
<id>https://git.shady.money/coreutils/atom?h=v7.3</id>
<link rel='self' href='https://git.shady.money/coreutils/atom?h=v7.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/'/>
<updated>2009-04-02T23:34:11Z</updated>
<entry>
<title>ls: fix alignment when month names have varying widths</title>
<updated>2009-04-02T23:34:11Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2009-03-24T14:29:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=612b647dd16d5abc03b295abe42d8b4a0fe660f7'/>
<id>urn:sha1:612b647dd16d5abc03b295abe42d8b4a0fe660f7</id>
<content type='text'>
Reported by Samuel Thibault and Stéphane Raimbault, as the glibc fr_FR
locale has recently changed to use the official but variable width
abbreviated month names. Other glibc locales also have variable widths.
http://sourceware.org/ml/libc-locales/2008-q1/msg00035.html
http://sourceware.org/bugzilla/show_bug.cgi?id=9859
* NEWS: Mention the fix
* gl/lib/mbsalign.c: A new module to align and truncate a
string in a specified number of screen cells, while handling
multi-byte characters appropriately.
* gl/lib/mbsalign.h: Ditto
* gl/modules/mbsalign: Ditto
* bootstrap.conf: Reference the new module
* src/ls.c (abmon_init): New function, precompute the abbreviated
months aligned left in a minimum width column &lt;= 5 screen cells.
(align_nstrftime): New function, replace the first %b in the
format specification to strftime with the precomputed month string.
Note using the cached month strings speeds up `ls -lU` by around 17%
on glibc-2.7-2 on linux at least.  Also if we implement this function
using heap storage rather than automatic storage, and use snprintf
instead of strcpy, ls will slow down by 2% and 1% respectively
(i.e. a net gain of 14% rather than 17%).
* tests/ls/abmon-align: A new test to test ls alignment for
various formats and locales
* tests/Makefile.am: Reference the new test
</content>
</entry>
<entry>
<title>ls: make it possible to disable coloring of hard links</title>
<updated>2009-03-24T16:11:00Z</updated>
<author>
<name>Kamil Dudka</name>
<email>kdudka@redhat.com</email>
</author>
<published>2009-03-24T11:16:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=2827bb5704a153a0b4ac9c4af8b83ed015012f68'/>
<id>urn:sha1:2827bb5704a153a0b4ac9c4af8b83ed015012f68</id>
<content type='text'>
* src/ls.c (print_color_indicator): Don't color hard links if disabled
(when there is an empty hl= in the LS_COLORS environment variable).
* tests/ls/hardlink: Add test case for disabled hard link highlighting.
* NEWS: Mention the change.
</content>
</entry>
<entry>
<title>tests: using printf with \e for ESC isn't portable</title>
<updated>2009-02-25T21:43:07Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2009-02-25T18:51:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=bba5a47651a4a09f745f7f996c3b22fc410fabef'/>
<id>urn:sha1:bba5a47651a4a09f745f7f996c3b22fc410fabef</id>
<content type='text'>
* tests/ls/color-clear-to-eol: Use \33, not \e for ascii ESC.
This test failed when using the built-in printf of /bin/sh from
NetBSD 1.6.
</content>
</entry>
<entry>
<title>ls: clean up after wrapped+colored file names with clear-to-EOL</title>
<updated>2009-02-10T13:47:39Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2008-12-31T18:17:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=adc62b5d9f3b4ab575c57b1b76eb6ad257a09f2c'/>
<id>urn:sha1:adc62b5d9f3b4ab575c57b1b76eb6ad257a09f2c</id>
<content type='text'>
This change addresses a relatively unusual case: ls --color, with
a highlighted name being printed initially in the last row of a
terminal emulator (possibly followed by other lines of output) such
that it is wrapped onto the following line, as the terminal emulator
scrolls the output.  That would cause the entire following line to
be highlighted, even if the name happened to use only one position.
The least-invasive patch would have made colorized output larger for
all uses.  The approach taken below is more invasive, but limits the
increase in overhead to only those lines that are expected to wrap.
* src/ls.c (enum indicator_no): Add C_CLR_TO_EOL.
(indicator_name): Add "cl".
(color_indicator): Add default escape codes for "cl".
(print_long_format): Propagate width to print_name_with_quoting.
(print_name_with_quoting): Print new C_CLR_TO_EOL string if needed.
Return the width of what we're printing.
(print_file_name_and_frills): Propagate width.
(print_type_indicator): Return bool (aka width).
(print_many_per_line): Pass column position to print_* function.
(print_current_files): Likewise.
(print_horizontal): Likewise.
(print_with_commas): Likewise.
* src/dircolors.c (slack_codes): Add "CLRTOEOL".
(ls_codes): Add "cl".
* tests/ls/color-clear-to-eol: New file.  Test for this fix.
* tests/Makefile.am (TESTS): Add ls/color-clear-to-eol.
* THANKS: Update.
Reported by Alexander V. Lukyanov.  See thread for details:
http://thread.gmane.org/gmane.linux.kernel/740021/focus=14824
Thanks to Jan Engelhardt for helping me reproduce the problem.

Demonstrate with this in an 80-column xterm:
  seq 200 # to start in the "bottom" row
  touch zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz.foo
  env LS_COLORS='*.foo=0;31;42' ls -og --color=always

Before the fix, you'd see something like this:
(where the file name is printed in red on a green background,
and each "=" denotes a space on a green background)
...
  -rw-r--r--  1       0 Feb  5 11:31 zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\
  zzzzzzzzzzzzzz.foo===================================================

After the patch, the trailing green spaces are gone:

  -rw-r--r--  1       0 Feb  5 11:31 zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\
  zzzzzzzzzzzzzz.foo
</content>
</entry>
<entry>
<title>tests: remove debug code that would try to write into /t/k-env</title>
<updated>2008-11-16T09:45:41Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2008-11-16T09:45:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=4e38e6a19cb67c6fbee6c4c1e477748776818bab'/>
<id>urn:sha1:4e38e6a19cb67c6fbee6c4c1e477748776818bab</id>
<content type='text'>
* tests/ls/no-cap: Remove debugging "tee".
</content>
</entry>
<entry>
<title>ls: --color now highlights hard linked files, too</title>
<updated>2008-10-28T20:08:30Z</updated>
<author>
<name>Kamil Dudka</name>
<email>kdudka@redhat.com</email>
</author>
<published>2008-10-27T14:38:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=1e48b1fee5fa2ad2d1802771eafbfcddb38a24cb'/>
<id>urn:sha1:1e48b1fee5fa2ad2d1802771eafbfcddb38a24cb</id>
<content type='text'>
* src/ls.c (print_color_indicator): Colorize hard linked files.
* src/dircolors.c: Add color for hard link.
* src/dircolors.hin: Add color for hard link.
* tests/ls/hardlink: Test for ls - colorize hard linked files.
* tests/Makefile.am (TESTS): Add ls/hardlink.
* NEWS: Mention the change.
</content>
</entry>
<entry>
<title>tests: ls/stat-failed: don't discard stderr.</title>
<updated>2008-10-28T08:24:01Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2008-10-28T08:24:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=5dc070cc866477bc4899221ecceb1c294db99371'/>
<id>urn:sha1:5dc070cc866477bc4899221ecceb1c294db99371</id>
<content type='text'>
* tests/ls/stat-failed: Let stderr be recorded, to ease debugging.
</content>
</entry>
<entry>
<title>tests: test today's ls-vs-capability fix</title>
<updated>2008-10-21T11:09:58Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2008-10-21T11:09:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=028e12ce3bea55b791cf339d2b12834e5091a5e5'/>
<id>urn:sha1:028e12ce3bea55b791cf339d2b12834e5091a5e5</id>
<content type='text'>
Test for this fix: f3f1ccfd871ee395e7fafc051c1b7dedb39fdfc9.
* tests/Makefile.am (TESTS): Add ls/no-cap.
* tests/ls/no-cap: New file.
</content>
</entry>
<entry>
<title>tests: skip a root-only test when configured without libcap</title>
<updated>2008-10-02T13:54:36Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2008-10-02T13:54:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=7eb15e1020590ebc1f39e5679feea8f1106d241c'/>
<id>urn:sha1:7eb15e1020590ebc1f39e5679feea8f1106d241c</id>
<content type='text'>
* tests/ls/capability: Test for HAVE_CAP definition in config.h.
</content>
</entry>
<entry>
<title>tests: use "Exit $fail", not (exit $fail); exit $fail</title>
<updated>2008-09-10T11:20:10Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2008-09-07T08:31:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=68561594ca022703e255b3ef5686f176317e5fd4'/>
<id>urn:sha1:68561594ca022703e255b3ef5686f176317e5fd4</id>
<content type='text'>
* tests/test-lib.sh (Exit): New function by Ralf Wildenhues in automake
http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=20594c08f63
* tests/**: Convert all uses:

This restrictive change converted the vast majority:

  git grep -l '^(exit \$fail); exit \$fail$' \
    | xargs perl -pi -e 's/'^\(exit \$fail\); exit \$fail$/Exit \$fail/'

And this did the rest, plus a few undesirable ones, so I manually
backed out the changes to ChangeLog-* and build-aux/check.mk:

  git grep -l -E '\(exit [^)]+\); exit ' \
    | xargs perl -pi -e 's/\(exit (.+?)\); exit \1/Exit $1/'
</content>
</entry>
</feed>
