summaryrefslogtreecommitdiff
path: root/src/ls.c
AgeCommit message (Collapse)Author
2009-11-09ls: fix capability coloringPádraig Brady
Capability checking was incorrectly done on just the base name rather than on the whole path. Consequently there could be both false positives and negatives when coloring files with capabilities. Also capability checking was not done at all in certain cases for non executable files. Note passing absolute rather than relative names to cap_get_file() reduces the has_capability() overhead from around 33% to 30%. I.E. ls --color is now around 3% faster. * src/ls.c (struct fileinfo): Add a has_capability member. (print_color_indicator): Refactor to pass just a fileinfo pointer and a flag to say if we're dealing with a symlink target. (print_name_with_quoting): Likewise. (gobble_file): Set has_capability in the fileinfo struct. Also do a capability check even if executable coloring is disabled. Ditto for SETUID and SETUID coloring. Comment on how expensive has_capability() is. (print_long_format): Adjust to refactored print_name_with_quoting. (quote_name): Likewise. (print_file_name_and_frills): Likewise. * tests/ls/capability: Test the various false positive and negatives. * THANKS: Add reporter (Ivan Labath). * NEWS: Mention the fix.
2009-10-09ls: remove explicit getfilecon work-aroundJim Meyering
* src/ls.c (gobble_file): Remove l?getfilecon work-around, now that the gnulib wrappers handle it for us.
2009-09-30ls: always print "?" for allocated size of a dereferenced dangling symlinkPádraig Brady
Previously for `ls -Ls` (but not `ls -Lsl`), we referenced the st_blocks returned from the previous failed stat() call. This undefined value was seen to be 0 for dangling symlinks at least. * src/ls.c (print_file_name_and_frills, length_of_file_name_and_frills): Don't use st_blocks if the previous stat() failed * tests/ls/dangle: Add a test case * NEWS: Mention the fix, and roll up related items into a single entry.
2009-09-29ls: don't use an undefined struct stat after failed stat/lstatJim Meyering
* src/ls.c (format_inode): Access f->stat only if f->stat_ok is set. * NEWS (Bug fixes): Mention it. Improved-by: Pádraig Brady <P@draigBrady.com>
2009-09-29ls: print "?", not "0" as inode of dereferenced dangling symlinkJim Meyering
ls prints inode numbers two ways: for long (-l) listings, and for short ones, e.g., ls -li and ls -i. The code to print long listings properly printed "?" when the inode was unknown, but the code for handling short listings would print 0 instead. Factor out the formatting code into a new function so ls prints the right string ("?") from both places: * NEWS (Bug fixes): Mention it. * src/ls.c (format_inode): New function. (print_long_format): Use it here. (print_file_name_and_frills): Use it here, too. * tests/ls/dangle: Exercise this fix. Reported by Yang Ren in http://bugzilla.redhat.com/525400
2009-09-29ls: with -LR, exit with status 2 upon detecting a cycleJim Meyering
* src/ls.c (print_dir): Diagnosing the cycle is not enough. Also set exit status to 2. This is what Solaris' /bin/ls does, too. * tests/ls/infloop: Rework test: match both expected stdout and stderr. Require an exit status of 2 in this case. * doc/coreutils.texi (ls invocation): Mention that a loop provokes in an exit status of 2. * NEWS (Bug fixes): Mention it. Reported by Yang Ren in http://bugzilla.redhat.com/525402. * THANKS: Correct ordering of Yang Ren's names.
2009-09-23maint: Use logical rather than bitwise operators on boolsPádraig Brady
This is because bitwise operators are: - confusing and inconsistent in a boolean context - non short circuiting - brittle in C89 where bool can be an int (so > 1)
2009-09-23doc: ls: further improve --help message re --colorJim Meyering
* src/ls.c (usage): Correct grammar, change voice, shorten. Inspired by a report from Bruno Schulenberg.
2009-09-22ls: fix a performance regressionPádraig Brady
* src/ls.c (print_color_indicator): This reinstates commit f3f1ccfd, 21-10-2008, "ls: make it possible to disable file capabilities checking" which was inadvertently reverted with commit 3a169f4c, 14-09-2009, "ls: handle disabling of colors consistently ...".
2009-09-21doc: ls: add an article, "the"Jim Meyering
* src/ls.c (usage): Tweak wording.
2009-09-21ls: handle disabling of colors consistently for all tile typesPádraig Brady
* src/ls.c (print_color_indicator): Use consistent syntax for all file and directory subtypes, and fall back to the color of the base type if there is no enabled color for the subtype. This allows turning off specific colors for o+w dirs for example. * tests/ls/color-dtype-dir: Add a case to test that turning off coloring for o+w directories, falls back to standard dir color. * NEWS: Mention the fix Introduced by commit ac467814, 2005-09-05, "Colorize set-user-ID ... files and sticky ... directories."
2009-09-21doc: ls: make help for --color more concise and accuratePádraig Brady
* src/ls.c (usage): Shorten the --color ancillary info by two lines, while replacing --color=none with --color=never. Mention "always" is the default parameter of the --color option, along with the primary help for that option. Mention the ancillary --color info in the --color primary help.
2009-09-21doc: mention the texinfo documentation in --helpPádraig Brady
* src/system.h: Rename emit_bug_reporting_address() to emit_ancillary_info() and update it to not print the translation project address in en_* locales, and _do_ print it in the 'C' (and other) locales so that it's included in the default man page. Also mention how to invoke the texinfo documentation for each command. Also move the "hard-locale.h" include to the 8 files that now use it. * man/help2man: Strip the newly added texinfo reference from the --help output as a more verbose version is already added by help2man. Suggestion from C de-Avillez
2009-09-10doc: improve various BLOCKSIZE and SIZE helpOndřej Vašík
* doc/coreutils.texi (multiplierSuffixes): Mention that the suffix can be specified without a leading number * src/split.c (usage): Refactor SIZE help to within a function * src/truncate.c (usage): Likewise * src/ls.c (usage): Likewise * src/df.c (usage): Likewise. Also add a function with BLOCKSIZE help * src/du.c (usage): Likewise. * src/system.h: Define 2 functions to emit common help text This was prompted by https://bugzilla.redhat.com/show_bug.cgi?id=511188
2009-09-01ls -i: print consistent inode numbers also for mount pointsJim Meyering
On most unix- and linux-based kernels, ls -i DIR_CONTAINING_MOUNT_POINT would print the wrong inode number for any entry that is a mount point. It would do that by relying on readdir's dirent.d_ino values, while most readdir implementations return the inode number of the underlying, inaccessible directory. Thus, it is not consistent with what you'd get when applying stat to the same entry. This bug led to surprising results like "ls -i" and "ls -i --color" printing different numbers (ls must usually "stat" a file to colorize its name). This change makes it so that on offending systems, ls must stat non-command-line-arguments for which otherwise it would be able to use "for free" dirent.d_ino values. Regardless of this change, ls is already required to stat every command-line argument. Note: versions of GNU ls prior to coreutils-6.0 did not perform the invalid optimization, and hence always printed correct inode numbers. Thus, for the sake of correctness, ls -i is forgoing the readdir optimization, for any kernel (including linux!) with POSIX-nonconforming readdir. Note that currently, only Cygwin has been agile enough to conform. * src/ls.c (RELIABLE_D_INO): Define. (print_dir): Use it. For plenty of discussion, see this long thread: http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/14020 This bug was introduced by the 2006-02-26 commit, 33eb3efe: "In ls, avoid calling stat for --inode (-i), when possible." * tests/ls/readdir-mountpoint-inode: New test. * tests/Makefile.am (TESTS): Add it. * tests/ls/stat-vs-dirent: Don't suppress failure of this test, now that ls -i is fixed. Though note that it doesn't test well, since it compares only the always-stat'd command-line arguments. * NEWS (Bug fixes): Mention it.
2009-08-25global: convert indentation-TABs to spacesJim Meyering
Transformed via this shell code: t=$'\t' git ls-files \ | grep -vE '(^|/)((GNU)?[Mm]akefile|ChangeLog)|\.(am|mk)$' \ | grep -vE 'tests/pr/|help2man' \ | xargs grep -lE "^ *$t" \ | xargs perl -MText::Tabs -ni -le \ '$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_'
2009-07-27ls -1U dir arg ... now works againKamil Dudka
* src/ls.c (print_dir): Emit "$dir_name:\n" *before* accumulating (and possibly printing) directory entry names. The bug was introduced in coreutils-7.0 via commit 8d974b00, 2008-07-30, "ls -U1 now uses constant memory". Reported by Julian Bradfield. * NEWS (Bug fixes): Mention it.
2009-06-11ls --color: do not colorize files with multiple hard links by defaultKamil Dudka
* src/ls.c: Rename hl->mh, do not colorize files with multiple hard links by default. * src/dircolors.c: Rename HARDLINK -> MULTIHARDLINK, hl -> mh. * src/dircolors.hin: Do not colorize files with multiple hard links by default. * tests/Makefile.am: Rename the test case accordingly. * tests/ls/multihardlink: Additionally test ls' default behavior and factor out some duplication. * NEWS: Mention the change in behavior.
2009-05-17maint: use ARRAY_CARDINALITY moreJim Meyering
* src/sort.c (main): Use ARRAY_CARDINALITY, rather than open-coding it. * src/factor.c (WHEEL_END): Likewise. * src/csplit.c (main): Likewise. * src/od.c: Likewise, * src/ls.c (main): Likewise. (N_ENTRIES): Remove definition. Use ARRAY_CARDINALITY instead. * src/dircolors.c: Likewise. (array_len): Remove definition.
2009-04-07maint: Clarify ambiguous refs to Linux kernels or GNU/Linux systemsPádraig Brady
* README-prereq: s_linux_GNU/Linux_ or s_linux_Linux kernel_ * README-valgrind: ditto * src/chown-core.c: ditto * src/dd.c: ditto * src/df.c: ditto * src/ls.c: ditto * src/mv.c: ditto * src/pwd.c: ditto * src/remove.c: ditto * src/shred.c: ditto * src/stat.c: ditto * src/su.c: ditto * src/system.h: ditto * src/timeout.c: ditto * src/truncate.c: ditto
2009-04-03ls: fix alignment when month names have varying widthsPádraig Brady
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 <= 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
2009-04-02doc: Clarify the help for version sorting in ls and sortPádraig Brady
* src/ls.c: Update the -v help description * src/sort.c: Update the -V help description
2009-03-24ls: make it possible to disable coloring of hard linksKamil Dudka
* 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.
2009-03-06maint: avoid new unused-macro warnings from gccJim Meyering
* src/ls.c (ASSERT_MATCHING_DEV_INO): Comment-out unused definition, to match commented-out use. * src/install.c (INITIAL_HASH_MODULE, INITIAL_ENTRY_TAB_SIZE): (READ_SIZE): Remove definitions of unused macros. * src/mv.c (INITIAL_HASH_MODULE, INITIAL_ENTRY_TAB_SIZE): Likewise. * src/dd.c (max): Likewise. * src/expand.c (OUTPUT_BLOCK): Likewise. * src/csplit.c (ALLOC_SIZE): Likewise. * src/pr.c (NULLCOL): Likewise. * src/ptx.c (Sword): Likewise. * src/unexpand.c (OUTPUT_BLOCK): Likewise. * src/factor.c (NDEBUG): Likewise.
2009-02-20doc: ls: clarify description of -sJim Meyering
* src/ls.c (usage): Make the description of -s mention "allocated size", so that it's less likely to be confused with an apparent byte-count. Suggested by Vito Caputo.
2009-02-10ls: clean up after wrapped+colored file names with clear-to-EOLJim Meyering
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
2009-01-01cleanup/modernize: don't test HAVE_MBRTOWC; now gnulib provides itJim Meyering
* bootstrap.conf (gnulib_modules): Include mbrtowc explicitly. * src/ls.c (quote_name): Don't test HAVE_MBRTOWC, now that we're guaranteed to have the function. * src/wc.c (wc): Likewise.
2008-12-01avoid warnings about initialization of automatic aggregatesJim Meyering
* src/system.h (DZA_CONCAT0, DZA_CONCAT): New macros. (DECLARE_ZEROED_AGGREGATE): New macro. * src/ls.c (quote_name): Use it. * src/pathchk.c (portable_chars_only): Use it. * src/shred.c (main): Use it. * src/stty.c (main): Use it. * src/wc.c (SUPPORT_OLD_MBRTOWC): Use it.
2008-11-10make --help print "Report PROGRAM translation bugs to <...>."Jim Meyering
for all but the C/POSIX locale. * src/system.h: Include "hard-locale.h". (emit_bug_reporting_address): Tell where to report translation bugs. don't include "hard-locale.h", now that system.h does * src/comm.c: Likewise. * src/join.c: Likewise. * src/ls.c: Likewise. * src/pinky.c: Likewise. * src/pr.c: Likewise. * src/sort.c: Likewise. * src/uniq.c: Likewise. * src/who.c: Likewise.
2008-11-10avoid warnings about discarding "qualifiers from pointer target type"Jim Meyering
Use the new "bad_cast" function or an actual cast-to-"(char *)" to avoid warnings. * src/system.h (bad_cast): Define. * src/chown.c (main): * src/chroot.c (main): * src/date.c (main): * src/du.c (main): * src/expand.c (stdin_argv): * src/ls.c (decode_switches): * src/md5sum.c (main): * src/paste.c (main): * src/pr.c (col_sep_string, column_separator, line_separator, main): * src/sort.c (main): * src/split.c (main): * src/tail.c (main): * src/unexpand.c (stdin_argv): * src/yes.c (main):
2008-10-28ls: --color now highlights hard linked files, tooKamil Dudka
* 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.
2008-10-23ls: use '.' (not +) as SELinux-only alt. access flag in ls -l outputJim Meyering
* src/ls.c (gobble_file) [long_format]: Map SELinux-only to '.', any other nonempty combination of MAC and ACL to '+', and all else to the usual ' '. Suggested by Michael Stone. * tests/misc/selinux: Adapt: expect '.', not '+'. * doc/coreutils.texi (What information is listed): Document this. * NEWS (Changes in behavior): Mention it.
2008-10-22* src/ls.c (usage): Describe exit statuses more concisely.Paul Eggert
2008-10-21ls: make it possible to disable file capabilities checkingKamil Dudka
* ls.c (print_color_indicator): Do not check for file capability if that attribute is not being colored. Since 84f6abfe00b4ab533145623638b417a2221f9c75, ls --color would check each file for "capabilities". In <http://bugzilla.redhat.com/467508>, James Antill reported that ls --color seemed slower with capabilities detection.
2008-10-21reflect gnulib's removal of lstat.hJim Meyering
* src/copy.h: Don't include "lstat.h". * src/ls.c: Likewise. * src/remove.c: Likewise. * src/rm.c: Likewise.
2008-10-19accommodate gnulib header removalsJim Meyering
* src/copy.c: Don't include "euidaccess.h" or "lchmod.h". * src/cp.c: Don't include "lchmod.h". * src/ls.c: Don't include "dirfd.h". * src/mkdir.c: Don't include "lchmod.h". * src/pwd.c: Don't include "dirfd.h". * src/remove.c: Don't include "dirfd.h" or "euidaccess.h". * src/test.c: Don't include "euidaccess.h". * gl/modules/getloadavg.diff: Adjust diff for changed context. * src/uptime.c (uptime): Remove declaration.
2008-10-17maint: avoid warning in ls.cJim Meyering
* src/ls.c (has_capability) [!HAVE_CAP]: Add unused attribute.
2008-10-13doc: adjust spacing in ls --help output, for better man formattingJim Meyering
* src/ls.c (usage): Adjust spacing so the "Exit status:" list renders well in the help2man-generated man page.
2008-10-13doc: ls: clarify exit status descriptionOndřej Vašík
* src/ls.c (exit_status): Clarify comments. (usage): Clarify exit status description in --help output. * doc/coreutils.texi (ls invocation): Clarify exit status documentation Reported by Greg Metcalfe in <http://bugzilla.redhat.com/446294>.
2008-10-03ls and sort: use filevercmp instead of strverscmpKamil Dudka
* src/ls.c (cmp_version): Use filevercmp instead of strverscmp. * src/sort.c (usage): Remove mna reference to strverscmp(3). (compare_version): Use filevercmp instead of strverscmp. * bootstrap.conf: Add filevercmp to list of gnulib modules. * tests/misc/sort-version: Remove conflicting string and enhance test. * NEWS: Mention the change.
2008-08-20ls: adjust to gnulib changeEric Blake
* src/ls.c (includes): "strverscmp.h" no longer exists.
2008-08-05ls: ignore spurious getfilecon failure due to lack of SELinux supportJohn David Anglin
* src/ls.c (gobble_file): Upon failed getfilecon, treat an errno value of EOPNOTSUPP just like ENOTSUP. See <http://bugs.debian.org/488549>.
2008-08-01ls: --color now highlights files with capabilities, tooKamil Dudka
* src/ls.c: [HAVE_CAP] Include <sys/capability.h>. (has_capability): New function for capability detection. (print_color_indicator): Colorize file with capability. * m4/jm-macro.m4: New configure option: --disable-libcap. Check for libcap usability. * src/Makefile.am (dir_LDADD, ls_LDADD, ...): Append $(LIB_CAP). * src/dircolors.c: Update color lists. * src/dircolors.hin: Mention new CAPABILITY color attribute. * tests/ls/capability: Test for ls - colorize file with capability. * tests/Makefile.am (root_tests): Add ls/capability. * NEWS: Mention the change.
2008-08-01ls -U1 now uses constant memoryKamil Dudka
When printing one name per line and not sorting, ls now uses constant memory per directory, no matter how many files are in the directory. * ls.c (print_dir): Print each file name immediately, when possible. * NEWS: Mention the improvement.
2008-06-27factor out time_t-to-string conversion idiomJim Meyering
* src/system.h: Include "inttostr.h". (timetostr): New function, factored out of... * src/date.c (show_date): Use timetostr. * src/du.c (show_date): Likewise. * src/ls.c (print_long_format): Likewise. * src/pinky.c (time_string): Likewise. * src/stat.c (human_time): Likewise. * src/*.c: Don't include inttostr.h, since system.h does. * src/c99-to-c89.diff: Adjust offsets.
2008-06-17ls, od: avoid redundant constEric Blake
* src/ls.c (long_time_format, sort_functions): Avoid redundant const. * src/od.c (charname): Likewise. * maint.mk (sc_redundant_const): Add rule to detect this.
2008-06-16remove redundant const directivesJim Meyering
In 1463824d8e7f72c31f1d803d7cfe2b608ccafc5c, I added some missing "const" directives, as well as some new, redundant ones. This removes the redundant ones. Pointed out by Eric Blake. * base64.c, cat.c, chcon.c, chgrp.c, chmod.c, chown.c, comm.c: * cp.c, csplit.c, cut.c, date.c, dd.c, df.c, dircolors.c, du.c: * env.c, expand.c, fmt.c, fold.c, groups.c, head.c, id.c: * install.c, join.c, kill.c, ln.c, ls.c, md5sum.c, mkdir.c: * mkfifo.c, mknod.c, mktemp.c, mv.c, nice.c, nl.c, od.c: * paste.c, pathchk.c, pinky.c, pr.c, ptx.c, readlink.c, rm.c: * rmdir.c, runcon.c, seq.c, shred.c, shuf.c, sort.c, split.c: * stat.c, stty.c, su.c, sum.c, tac.c, tail.c, tee.c, timeout.c: * touch.c, tr.c, truncate.c, tty.c, uname.c, unexpand.c, uniq.c: * wc.c, who.c: Remove redundant const directives. * maint.mk (sc_const_long_option): Don't require redundant "const".
2008-06-14add "const" attribute, where possibleJim Meyering
* maint.mk (sc_const_long_option): New rule. Enforce global change. * src/base64.c (long_options): Use "const" where possible. * src/cat.c (main): Likewise. * src/chcon.c (long_options): Likewise. * src/chgrp.c (long_options): Likewise. * src/chmod.c (long_options): Likewise. * src/chown.c (long_options): Likewise. * src/comm.c (long_options, OUTPUT_DELIMITER_OPTION): Likewise. * src/cp.c (long_opts): Likewise. * src/csplit.c (longopts): Likewise. * src/cut.c (longopts): Likewise. * src/date.c (long_options): Likewise. * src/dd.c (conversions, flags, statuses): Likewise. * src/df.c (long_options): Likewise. * src/dircolors.c (long_options): Likewise. * src/du.c (long_options): Likewise. * src/env.c (longopts): Likewise. * src/expand.c (longopts): Likewise. * src/fmt.c (long_options): Likewise. * src/fold.c (longopts): Likewise. * src/groups.c (longopts): Likewise. * src/head.c (long_options): Likewise. * src/id.c (longopts): Likewise. * src/install.c (long_options): Likewise. * src/join.c (longopts): Likewise. * src/kill.c (long_options): Likewise. * src/ln.c (long_options): Likewise. * src/ls.c (long_time_format, long_options, sort_functions): Likewise. * src/md5sum.c (long_options): Likewise. * src/mkdir.c (longopts): Likewise. * src/mkfifo.c (longopts): Likewise. * src/mknod.c (longopts): Likewise. * src/mktemp.c (longopts): Likewise. * src/mv.c (long_options): Likewise. * src/nice.c (longopts): Likewise. * src/nl.c (longopts): Likewise. * src/od.c (charname, long_options): Likewise. * src/paste.c (longopts): Likewise. * src/pathchk.c (longopts): Likewise. * src/pinky.c (longopts): Likewise. * src/pr.c (long_options): Likewise. * src/ptx.c (long_options): Likewise. * src/readlink.c (longopts): Likewise. * src/rm.c (long_opts): Likewise. * src/rmdir.c (longopts): Likewise. * src/runcon.c (long_options): Likewise. * src/seq.c (long_options): Likewise. * src/shred.c (long_opts): Likewise. * src/shuf.c (long_opts): Likewise. * src/sort.c (monthtab, long_options): Likewise. * src/split.c (longopts): Likewise. * src/stat.c (long_options): Likewise. * src/stty.c (mode_info, control_info, longopts, set_mode) Likewise. (set_control_char, speeds): Likewise. * src/su.c (longopts): Likewise. * src/sum.c (longopts): Likewise. * src/tac.c (longopts): Likewise. * src/tail.c (long_options): Likewise. * src/tee.c (long_options): Likewise. * src/timeout.c (long_options): Likewise. * src/touch.c (longopts): Likewise. * src/tr.c (long_options): Likewise. * src/truncate.c (longopts): Likewise. * src/tty.c (longopts): Likewise. * src/uname.c (uname_long_options, arch_long_options): Likewise. * src/unexpand.c (longopts): Likewise. * src/uniq.c (longopts): Likewise. * src/wc.c (longopts): Likewise. * src/who.c (longopts): Likewise.
2008-06-03use gnulib's progname moduleJim Meyering
* bootstrap.conf (gnulib_modules): Add progname. * src/*.c (program_name): Remove declaration. * (main): Call set_program_name rather than setting program_name. * src/nice.c (main): Cast program_name to "(char *)". * src/prog-fprintf.c: Include "system.h" * src/system.h: Include "progname.h". * maint.mk (sc_program_name): Adjust rule. Suggestion from Eric Blake.
2008-06-02declare program_name consistentlyJim Meyering
* src/base64.c: Likewise. * src/basename.c: Likewise. * src/cat.c: Likewise. * src/chcon.c: Likewise. * src/chgrp.c: Likewise. * src/chmod.c: Likewise. * src/chown.c: Likewise. * src/chroot.c: Likewise. * src/cksum.c: Likewise. * src/comm.c: Likewise. * src/cp.c: Likewise. * src/csplit.c: Likewise. * src/cut.c: Likewise. * src/date.c: Likewise. * src/dd.c: Likewise. * src/df.c: Likewise. * src/dircolors.c: Likewise. * src/dirname.c: Likewise. * src/du.c: Likewise. * src/echo.c: Likewise. * src/env.c: Likewise. * src/expand.c: Likewise. * src/expr.c: Likewise. * src/factor.c: Likewise. * src/fmt.c: Likewise. * src/fold.c: Likewise. * src/groups.c: Likewise. * src/head.c: Likewise. * src/hostid.c: Likewise. * src/hostname.c: Likewise. * src/id.c: Likewise. * src/install.c: Likewise. * src/join.c: Likewise. * src/kill.c: Likewise. * src/link.c: Likewise. * src/ln.c: Likewise. * src/logname.c: Likewise. * src/ls.c: Likewise. * src/md5sum.c: Likewise. * src/mkdir.c: Likewise. * src/mkfifo.c: Likewise. * src/mknod.c: Likewise. * src/mktemp.c: Likewise. * src/mv.c: Likewise. * src/nice.c: Likewise. * src/nl.c: Likewise. * src/nohup.c: Likewise. * src/od.c: Likewise. * src/paste.c: Likewise. * src/pathchk.c: Likewise. * src/pinky.c: Likewise. * src/pr.c: Likewise. * src/printenv.c: Likewise. * src/printf.c: Likewise. * src/ptx.c: Likewise. * src/pwd.c: Likewise. * src/readlink.c: Likewise. * src/rm.c: Likewise. * src/rmdir.c: Likewise. * src/runcon.c: Likewise. * src/seq.c: Likewise. * src/setuidgid.c: Likewise. * src/shuf.c: Likewise. * src/sleep.c: Likewise. * src/sort.c: Likewise. * src/split.c: Likewise. * src/stat.c: Likewise. * src/stty.c: Likewise. * src/su.c: Likewise. * src/sum.c: Likewise. * src/sync.c: Likewise. * src/tac.c: Likewise. * src/tail.c: Likewise. * src/tee.c: Likewise. * src/test.c: Likewise. * src/timeout.c: Likewise. * src/touch.c: Likewise. * src/tr.c: Likewise. * src/true.c: Likewise. * src/tsort.c: Likewise. * src/tty.c: Likewise. * src/uname.c: Likewise. * src/unexpand.c: Likewise. * src/uniq.c: Likewise. * src/unlink.c: Likewise. * src/uptime.c: Likewise. * src/users.c: Likewise. * src/wc.c: Likewise. * src/who.c: Likewise. * src/whoami.c: Likewise. * src/yes.c: Likewise.