summaryrefslogtreecommitdiff
path: root/src/ls.c
AgeCommit message (Collapse)Author
2002-02-28(decode_switches, usage): Add --time-style=+FORMAT.Jim Meyering
2002-02-26Include "acl.h" rather than <sys/acl.h>.Jim Meyering
(USE_ACL): Remove; replaced by HAVE_ACL everywhere. (gobble_file): Use file_has_acl rather than doing it ourselves.
2002-01-21Don't include "xalloc.h", as system.h already does that via sys2.h.Jim Meyering
2002-01-20Avoid undefined behavior when strcoll fails,Jim Meyering
by resorting the directory with strcmp instead. Include <setjmp.h>. Include "quote.h". (compare_atime, rev_cmp_atime, compare_ctime, rev_cmp_ctime, compare_mtime, rev_cmp_mtime, compare_size, rev_comp_size, compare_name, rev_cmp_name, compare_extension, rev_cmp_extension, compare_version, rev_compare_version): Move before use, so that we can remove the forward declaration. Reimplement in terms of the new functions described below, using xstrcoll instead of strcoll. (failed_strcoll): New var. (xstrcoll): New function. (V): New type. (cmp_ctime, compstr_ctime, rev_str_ctime): New functions. (cmp_mtime, compstr_mtime, rev_str_mtime): Likewise. (cmp_atime, compstr_atime, rev_str_atime): Likewise. (cmp_size, compstr_size, rev_str_size): Likewise. (cmp_version): Likewise. (cmp_name, compstr_name, rev_str_name): Likewise. (cmp_extension, compstr_extension, rev_str_extension): Likewise. (sort_files): Use prototype for internal function var. If the strcoll-based comparison fails, fall back on a strcmp-based one.
2002-01-08(long_time_format): Extended translator comments.Jim Meyering
2001-12-21(usage): Deprecate --kilobytes. Document size suffixes.Jim Meyering
2001-12-02Use new macros, HELP_OPTION_DESCRIPTION and VERSION_OPTION_DESCRIPTIONJim Meyering
instead of hard-coding --help and --version descriptions.
2001-11-27The change of 2001-11-01 introduced a bug whereby some recursiveJim Meyering
listings didn't have a blank line between per-directory groups of files. (print_dir): Print a newline before each directory name except the first one, rather than after each except the last, since now (after the changes of 2001-11-01) detecting whether a `pending*' is the last would involve more work. Reported by Andreas Schwab. This change has no net effect. (main): Remove always-true conjunct and add a comment.
2001-11-26Don't include "gtod.h"Jim Meyering
(main): Don't `call' GETTIMEOFDAY_INIT.
2001-11-23(usage): Note that ``Mandatory arguments to long options are mandatoryJim Meyering
for short options too.''
2001-11-23Split usage strings so that --help and --versionJim Meyering
descriptions are alone in their own string.
2001-11-23(usage): Split --help output into smaller pieces.Jim Meyering
Use fputs, not printf.
2001-11-03(DEV_INO_PUSH): Avoid unnecessary copies.Jim Meyering
(dev_ino_pop): Likewise.
2001-11-02(dev_ino_pop): Cast 2nd arg of obstack_blank to `int'Jim Meyering
before negating to avoid warning from gcc on systems with 64-bit size_t. Rename global: s/trace_dirs/recursive/. (extract_dirs_from_files): Rename parameter: s/recursive/ignore_dot_and_dot_dot/.
2001-11-02Use XREALLOC. It's cleaner.Jim Meyering
2001-11-02Use XMALLOC in a several places. It's cleaner.Jim Meyering
2001-11-01Include dirfd.h.Jim Meyering
(print_dir): If dirfd fails, resort to using stat.
2001-11-01(struct pending) [st_ino, st_dev]: Remove just-added members.Jim Meyering
(queue_directory): Remove just-added 3rd parameter and associated code, and update callers. (print_dir): Get dev/inode pair via `fstat (dirfd (reading), ...', and call visit_dir to detect cycles here. Push the dev/inode pair onto the new stack. (dev_ino_obstack): New global. (DEV_INO_PUSH): New macro. (dev_ino_pop): New function. (ASSERT_MATCHING_DEV_INO): New macro. (visit_dir): Take two parameters (dev,ino), not one `pending'. (main): Initialized the dev_ino_obstack. Don't call visit_dir here. Get the dev/ino pair from the new stack, not from the pending entry.
2001-11-01Make ls -R detect directory cycles.Jim Meyering
Include hash.h, same.h, and xalloc.h. (INITIAL_TABLE_SIZE, LOOP_DETECT): Define. (active_dir_set): New global. (struct dev_ino): Declare. (dev_ino_hash, dev_ino_compare, dev_ino_free): New functions. (visit_dir, free_pending_ent): New functions. (main): Initialize the active_dir_set hash table, if necessary. Don't confuse a marker entry with a real one. Detect loops. Manage the set of active directories. Free the hash table. (queue_directory): Add a new parameter. Ensure that we set the new dev/ino members for each enqueued directory. Update all callers. (print_dir): Don't confuse a marker entry with a real one. (extract_dirs_from_files): Insert a marker entry before inserting the entries for subdirectories.
2001-11-01Don't try to print a NULL pointer.Jim Meyering
(main): Don't use ARGMATCH_TO_ARGUMENT. This reverts part of the 1998-12-31 change.
2001-10-20(usage): Improve the description of --dereference (-L).Jim Meyering
2001-10-20Declare some local variables to be `const', where appropriate.Jim Meyering
2001-09-17(usage): Fix typo in -g usage.Jim Meyering
-H now means --dereference-command-line.
2001-09-04(get_link_name): Update use of xreadlink.Jim Meyering
2001-09-01(get_link_name): Restore error-handling that was removed by preceding delta.Jim Meyering
2001-09-01Include "xreadlink.h".Jim Meyering
(get_link_name): Don't use PATH_MAX. Rewrite to use xreadlink.
2001-08-14(AUTHORS): Mark string for translation, since it contains the English word ↵Jim Meyering
`and'.
2001-08-12Work around non-compliant gettimeofday on Mac OS X 10.0.4,Jim Meyering
(aka Darwin 1.3.7) that caused the date of the first file listed in long output to be the current time rather than the file's mtime. The real work is in m4/gettimeofday.m4 and the wrapper function, lib/gettimeofday.c. Include gtod.h. (main): `Call' GETTIMEOFDAY_INIT. (print_long_format): Add a comment about gettimeofday.
2001-08-10(print_long_format): Simplify previous patch forJim Meyering
listing negative sizes, by adding OFF_T_MAX - OFF_T_MIN + 1 instead of doing a fancy conditional shift. This is simpler and it avoids GCC's bogus compile-time warning about shift counts. (As a bonus, it is portable to hosts that do not use twos-complement arithmetic. :-)
2001-08-10(print_long_format): Multiply the shift width by zeroJim Meyering
to avoid a warning from gcc on hosts with an unsigned type for the st_size member.
2001-08-10(print_long_format): If a file size is negative, assumeJim Meyering
the typical case where it has wrapped around from a positive value.
2001-08-04(quote_name): Pass 0 to mbsnwidth, since the defaultJim Meyering
got changed and we want the default now.
2001-06-16(main): Recheck global print_with_color after callingJim Meyering
parse_ls_color, since that function may have reset it. Based on a patch from Richard Dawe.
2001-06-16(print_long_format): Don't truncate user namesJim Meyering
or group names that are longer than 8 characters.
2001-05-24Use `#if D_TYPE_IN_DIRENT && defined DTTOIF' toJim Meyering
determine whether to enable the DT_INIT definition, not the less portable `#if defined _DIRENT_HAVE_D_TYPE || defined DTTOIF'. Reported by Eli Zaretskii.
2001-05-20Include "hard-locale.h".Jim Meyering
(nstrftime): New decl. (enum time_style): New enum. (time_style_args, time_style_types): New constants. (full_time): Remove. (long_time_format): Initialize to POSIX defaults. (TIME_STYLE_OPTION): New constant. (long_options, decode_switches, usage): Add --time-style support. (long_time_expected_width): Use nstrftime, not strftime. (print_long_format): Likewise. Increase initial size to match new full-iso time style.
2001-05-15(struct fileinfo.linkmode): Now st_mode.Jim Meyering
(print_color_indicator, print_name_with_quoting, print_type_indicator, length_of_file_name_and_frills): Use mode_t, not unsigned int, to store modes. (dired_dump_obstack): Do not assume size fits in 'int'. (get_link_name): readlink returns ssize_t, not int. (make_link_path): Store buffer size as size_t, not int. (print_long_format): Use unsigned long, not unsigned, to print nlink_t, uid_t, gid_t, major_t, minor_t.
2001-05-13(enum Dereference_symlink): New type.Jim Meyering
(dereference): New var, replacing trace_links, which was removed. (long_options, main, decode_switches, gobble_file, usage): Implement the changes.
2001-05-12Include dirname.h, to get base_nameJim Meyering
2001-05-12(usage): Minor wording changes related to -o, -n, and -g.Jim Meyering
From Paul Eggert.
2001-05-05tweak diagnosticJim Meyering
2001-05-05(decode_switches): Complain if the envvar, QUOTING_STYLE,Jim Meyering
is set to an invalid value. Move some declarations of locals into scopes where they're used.
2001-05-05(print_owner): New global variable.Jim Meyering
(usage): Update the description of -g. (decode_switches): Honor the -g option (omit owner information), now that POSIX specifies it. (print_long_format): Don't print owner name if -g was specified. Move declaration of `user_name' into the scope where it's used. (print_group): Rename global from `inhibit_group'. Update all uses accordingly. (decode_switches): Make -n work just like -l, except with numeric IDs, per POSIX. Before, to have any effect, -n had to be used with -l. Reported by Dale Scheetz. (usage): Update the description of -n. Separate the descriptions of -n and --numeric-uid-gid. Split string in --help output that had exceeded my limit of 2048 bytes.
2001-04-22fix typo in commentJim Meyering
2001-04-22(decode_switches): Ensure that -1 has no effect when it follows -l.Jim Meyering
2001-04-22(main): Fix off-by-one error introduced with last change.Jim Meyering
2001-04-21(main): When given two or more arguments but the only oneJim Meyering
that exists is a directory, don't treat it as if it were the only argument. Before, `mkdir d; ls no-dir d 2>/dev/null' would act like `ls d' and produce no output. Now, it prints `d:'.
2001-04-04Don't inspect MB_LEN_MAX. Paul Eggert says it'sJim Meyering
not always defined correctly.
2001-02-20(FULL_TIME_OPTION): Renamed from FULL_TIME, forJim Meyering
consistency with the other enum values.
2001-02-20(SI_OPTION): New enum value.Jim Meyering
(long_options): Use it instead of 'H' for --si. (decode_switches): Warn that -H will change soon. (usage): Likewise.