<feed xmlns='http://www.w3.org/2005/Atom'>
<title>coreutils/src/ls.c, branch v8.26</title>
<subtitle>Mirror of https://https.git.savannah.gnu.org/git/coreutils.git/
</subtitle>
<id>https://git.shady.money/coreutils/atom?h=v8.26</id>
<link rel='self' href='https://git.shady.money/coreutils/atom?h=v8.26'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/'/>
<updated>2016-11-22T20:04:25Z</updated>
<entry>
<title>ls: improve alignment of quoted names</title>
<updated>2016-11-22T20:04:25Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2016-02-19T04:07:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=01971c0e3ff459b92d6faa2700a36c5bd45a329a'/>
<id>urn:sha1:01971c0e3ff459b92d6faa2700a36c5bd45a329a</id>
<content type='text'>
This provides better alignment when some names are quoted,
which also provides better indication that quotes are not
part of the name.

* src/ls.c (align_variable_outer_quotes): A new variable
set when ls is aligning columns (not using -m, non-zero -w),
and has a variable quoting style (shell, shell-escape, c-maybe).
(quote_name_buf): Writes to buffer rather than FILE,
taking care to avoid data copying if possible.  Refactored from...
(quote_name): ...here.  This now manages the buffer passed
to quote_name_buf() and outputs the padding, colors and name
in the appropriate order, while managing the --dired offsets.
(get_color_indicator): A new function to return the color sequence,
refactored from...
(print_color_indicator): ...here.  This now simply outputs.
(print_dir): Refactor common parts to quote_name().
(clear_files): Reset the flag indicating at least one
file is quoted in the current directory.
(needs_quoting): A new function to indicate at the scan stage
whether a name needs quoting.  Called from...
(gobble_file): ...here, until we find the first quoted file.
(print_name_with_quoting): Mostly refactored to quote_name().
* tests/ls/quote-align.sh: A new test for various output formats.
* tests/local.mk: Reference the new test.
* NEWS: Mention the improvement.
</content>
</entry>
<entry>
<title>doc: improve the --help description of ls -N</title>
<updated>2016-11-05T00:42:23Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2016-11-03T19:24:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=6f64cb64f7e1f14bb8968a8838cc3bbe9d28d10b'/>
<id>urn:sha1:6f64cb64f7e1f14bb8968a8838cc3bbe9d28d10b</id>
<content type='text'>
* src/ls.c (usage): The existing description was inaccurate
as -N does not directly impact whether control characters
are displayed or not.
</content>
</entry>
<entry>
<title>all: use die() rather than error(EXIT_FAILURE)</title>
<updated>2016-10-16T11:23:55Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2016-10-15T22:10:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=492dcb2eb191b844a2fd5e51db3eed85289bea1f'/>
<id>urn:sha1:492dcb2eb191b844a2fd5e51db3eed85289bea1f</id>
<content type='text'>
die() has the advantage of being apparent to the compiler
that it doesn't return, which will avoid warnings in some cases,
and possibly generate better code.
* cfg.mk (sc_die_EXIT_FAILURE): A new syntax check rule to
catch any new uses of error (CONSTANT, ...);
</content>
</entry>
<entry>
<title>build: add die.h; avoid new warnings from GCC 7</title>
<updated>2016-10-15T15:41:42Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@fb.com</email>
</author>
<published>2016-10-05T02:20:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=dad7ab0b7b322a800e6b1012b777169169068388'/>
<id>urn:sha1:dad7ab0b7b322a800e6b1012b777169169068388</id>
<content type='text'>
* src/die.h (die): New file/function from grep.
Note: we expect this file to migrate to gnulib.
* src/csplit.c: Include die.h.
(check_format_conv_type): Use die in place of error-nonzero;break;
* src/install.c (strip): Likewise.
* src/nl.c (proc_text): Likewise.  This also suppresses a new warning
from GCC 7's -Werror=strict-overflow.
* src/tail.c (parse_options): Likewise.
* src/basename.c (main): Adjust "fall through" comment
so that GCC 7's -Wimplicit-fallthrough honors it.
* src/cp.c (main): Add a "fall through" comment.
* src/ls.c (gobble_file): Likewise.
(get_funky_string): Adjust a "fall through" comment so it is
recognized.
* cfg.mk (exclude_file_name_regexp--sc_system_h_headers): Add die.h
to this list of exempt src/*.h files.
</content>
</entry>
<entry>
<title>ls: fix %%b format and precompute more</title>
<updated>2016-09-19T19:48:32Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2016-09-19T19:36:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=1db94ee969b984bbd00b97c6abbe2f69db8e0000'/>
<id>urn:sha1:1db94ee969b984bbd00b97c6abbe2f69db8e0000</id>
<content type='text'>
The old code mishandled --time-spec='+%%b', as it misinterpreted
the '%b' as being the month abbreviation.  Also, it mishandled
the extremely unlikely case of a month abbreviation containing '%'.
The performance part of this patch sped up 'ls' by about 1% on my
little benchmark of 'ls -lR' on the source directory in the
en_US.UTF-8 locale (Fedora 24 x86-64).
* NEWS: Document the bug fix.
* src/ls.c (first_percent_b, abformat_init): New static functions.
(ABFORMAT_SIZE): New constant.
(use_abformat): New static var.
(abmon, required_mon_width): Remove these static vars.
(abmon_init): Now accepts a pointer to abmon, and returns a boolean.
All callers changed.  Reject month abbrs containing '%', as these
would mess up strftime.  Simplify mbsalign result checking,
since (size_t) -1 exceeds ABFORMAT_SIZE.
(abformat_init, align_nstrftime): Precompute all 24 formats at
startup, rather than computing a format for each time stamp.
(decode_switches): Call abformat_init instead of abmon_init.
(align_nstrftime): Accept recentness bool instead of format.
All callers changed.
* tests/misc/time-style.sh: Test for format with '%%b'.
</content>
</entry>
<entry>
<title>ls: allow interruption when reading slow directories</title>
<updated>2016-09-07T09:16:59Z</updated>
<author>
<name>Kamil Dudka</name>
<email>kdudka@redhat.com</email>
</author>
<published>2016-09-06T15:38:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=5445f7811ff945ea13aa2a0fd797eb4c0a0e4db0'/>
<id>urn:sha1:5445f7811ff945ea13aa2a0fd797eb4c0a0e4db0</id>
<content type='text'>
Postpone installation of signal handlers until they're needed.
That is right before the first escape sequence is printed.

* src/ls.c (signal_setup): A new function refactored from main()
to set and restore signal handlers.
(main): Move signal handler setup to put_indicator()
so that the default signal handling is untouched as long as possible.
Adjusted condition for restoring signal handlers to reflect the change.
(put_indicator): Install signal handlers if called for the very first
time.  It uses the same code that was in main() prior to this commit.
* NEWS: Mention the improvement.

See https://bugzilla.redhat.com/1365933
Fixes http://bugs.gnu.org/24232
</content>
</entry>
<entry>
<title>date ls pr: fix time zone abbrs on SysV platforms</title>
<updated>2016-03-17T17:36:33Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2016-03-17T17:35:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=df88fce71651afb2c3456967a142db0ae4bf9906'/>
<id>urn:sha1:df88fce71651afb2c3456967a142db0ae4bf9906</id>
<content type='text'>
The problematic code computed a struct tm in one time zone, and
then printed it or converted it to a string in another.  To be
portable the same time zone needs to be used for both operations.
On GNU platforms this is not an issue, but incorrect output can be
generated on System V style platforms like AIX where time zone
abbreviations are available only in the 'tzname' global variable.
Problem reported by Assaf Gordon in: http://bugs.gnu.org/23035
* NEWS: Document the bug.
* src/date.c (show_date):
* src/ls.c (long_time_expected_width, print_long_format):
* src/pr.c (init_header):
* src/stat.c (human_time): Use localtime_rz instead of localtime,
so that the time zone information is consistent for both localtime
and time-formatting functions like fprintftime and nstrftime.  For
'stat' this change is mostly just a code cleanup but it also
causes stat to also print nanoseconds when printing time stamps
that are out of localtime range, as this is more consistent with
what other programs do.  For programs other than 'stat' this fixes
bugs with time zone formats that use %Z.
* src/du.c, src/pr.c (localtz): New static var.
(main): Initialize it.
* src/du.c (show_date): New time zone argument, so that localtime
and fprintftime use the same time zone information.  All callers
changed.
* tests/misc/time-style.sh: New file.
* tests/local.mk (all_tests): Add it.
* tests/misc/date.pl: Test alphabetic time zone abbreviations.
</content>
</entry>
<entry>
<title>maint: update all copyright year number ranges</title>
<updated>2016-01-01T14:10:41Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2016-01-01T14:10:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=b16e999f553b682e74e0a56750f649da05130c4f'/>
<id>urn:sha1:b16e999f553b682e74e0a56750f649da05130c4f</id>
<content type='text'>
Run "make update-copyright" and then...

* gnulib: Update to latest with copyright year adjusted.
* tests/init.sh: Sync with gnulib to pick up copyright year.
* bootstrap: Likewise.
* tests/sample-test: Adjust to use the single most recent year.
</content>
</entry>
<entry>
<title>maint: fix incorrect spellings etc</title>
<updated>2015-12-14T13:36:23Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2015-10-15T14:15:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=c609cd960d5cc309fe32ab315efe8dde79504d14'/>
<id>urn:sha1:c609cd960d5cc309fe32ab315efe8dde79504d14</id>
<content type='text'>
* NEWS: Use a standard version specification.
* doc/coreutils.texi: Fix incorrect grammar.
* src/df.c: Update a stale comment.
* src/copy.c: Fix incorrect spellings.
* src/factor.c: Likewise.
* src/ls.c: Likewise.
* src/pr.c: Likewise.
* src/relpath.c: Likewise.
* src/shred.c: Likewise.
* src/sort.c: Likewise.
* src/split.c: Likewise.
* src/stdbuf.c: Likewise.
* tests/misc/seq-precision.sh: Likewise.
</content>
</entry>
<entry>
<title>ls: default to --quoting=shell-escape for output to terminal</title>
<updated>2015-11-04T23:30:15Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2015-11-03T16:32:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=109b9220cead6e979d22d16327c4d9f8350431cc'/>
<id>urn:sha1:109b9220cead6e979d22d16327c4d9f8350431cc</id>
<content type='text'>
* src/ls.c (decode_switches): Set "shell-escape" if isatty().
* doc/coreutils.texi (ls invocation): Update the defaults description.
* NEWS: Mention the change in behavior.  It should not have
backwards compat issues, but mentioning here just in case.
</content>
</entry>
</feed>
