summaryrefslogtreecommitdiff
path: root/src/ls.c
AgeCommit message (Collapse)Author
1998-02-25Include new file quotearg.h.Jim Meyering
(enum indicator_style): Rename all to classify, and not_programs to file_type, to match option spellings. All users changed. (indicator_style_args): New constant. (quote_funny_chars, quote_as_string, quote_shell): Remove; (filename_quoting_options, dirname_quoting_options): Use these variables instead. (long_options): Add --indicator-style, --quoting-style, --show-control-chars. Remove --quote-shell. (dired_dump_obstack): Remove style parameter and don't output style. (main): Go back to previous method of outputting //DIRED// and //SUBDIRED// lines, without style. But add a new //DIRED-OPTIONS// line that does output style. (decode_switches, usage): Add --indicator-style, --quoting-style, --show-control-chars. Remove --quote-shell. (decode_switches): Default from QUOTING_STYLE environment variable. Set new quoting vars. (quote_name): Renamed from quote_filename. Take new arg specifying quoting options. Always print; do not have a special case for null FILE * argument. All callers changed. Move the guts of this function to new file quotearg.c. (length_of_file_name_and_frills): Use quotearg_buffer instead of (old) quote_filename to find length of file name. (decode_switches, parse_ls_color, print_dir, gobble_file, get_link_name): Quote output in diagnostics.
1998-01-23add curliesJim Meyering
1998-01-10(usage): Correct descriptions of --sort, --time, and -t.Jim Meyering
Suggestions from Andreas Schwab.
1998-01-10(decode_switches) [-u]: Fix bug whereby -u had no effectJim Meyering
without -l or -t. Now, -u (like -c) implies --sort=time. Suggestion from Andreas Schwab.
1998-01-04(main, usage): Check for write error to stdout before exiting.Jim Meyering
Include "closeout.h".
1997-12-31(decode_switches): -h and -H override output units.Jim Meyering
(print_dir, gobble_file, print_long_format, print_file_name_and_frills): Print disk allocations human readably.
1997-12-16s/__P/PARAMS/gJim Meyering
1997-12-16tweak indentationJim Meyering
1997-12-16(struct bin_str): Make len int, not unsigned, to avoidJim Meyering
bogus comparison < 0. (quote_filename): Add forward decl. (decode_switches): -b, -e, -N, -Q are now mutually exclusive. (print_dir): Quote directory name as per quoting options. (print_long_format): Don't count color changes as part of file name. (quote_filename): Revamp interface: now accepts stream to output to and filename, and returns length of quoted filename. This removes duplicated code and should make errors less likely. Also, no longer mallocs storage. All callers changed. Don't quote ' ' if -Q. (OUTCHAR): New macro. (SAVECHAR, SAVE_2_CHARS): Remove. (print_name_with_quoting): New stack arg. All callers changed. (print_color_indicator): Cast ext len to size_t to avoid warning with GCC 2.8. (length_of_file_name_and_frills): Rewrite to use quote_filename. This fixes bug when computing file name length with -e. 1997-12-14 Paul Eggert <eggert@twinsun.com> Add shell style quoting, and make it the default. * NEWS, doc/fileutils.texi: Describe -e, which is now the default. Describe change to --dired output. * src/ls.c (quote_shell): New var. (long_options, decode_switches, usage): New option -e or --quote-shell. (dired_dump_obstack): New arg STYLE. (main): Pass quoting style to dired_dump_obstack. (decode_switches): -N now clears quote_as_string. (quote_filename): Add shell style quoting.
1997-11-30(print_long_format): Rename inner-scoped `buf' arrays to `hbuf'Jim Meyering
to avoid shadowing local.
1997-11-30(<inttypes.h>): Include if HAVE_INTTYPES_H.Jim Meyering
("human.h"): Include. (<limits.h>): Don't include; system.h does it now. (INT_MAX): Remove. (longdiff): Remove bogus definition that uses subtraction; it gives the wrong answer when overflows occur. (convert_blocks): Remove. (output_units): New variable; replaces booleans kilobyte_blocks and megabyte_blocks. (human_readable_base): New variable. (long_options, usage): Add -h or --human-readable and -H or --si. (decode_switches): Adjust to renamed option variables. Use -H if BLOCKSIZE is SI. Add -h, -H. (print_dir): Count blocks using uintmax_t, not int. (gobble_file): Now returns uintmax_t, not int. Don't convert blocks to 512 byte units, as this might overflow; let caller handle the problem. Deduce what caller will print by invoking human_readable. (print_long_format, print_file_name_and_frills): Don't assume inode number, block count, file size fit in unsigned long. Use human_readable to do block count conversion and to print file sizes. (prep_non_filename_text): Print decimal string for time if localtime fails due to enormous time_t.
1997-10-25Remove old-style xmalloc and xrealloc decls.Jim Meyering
1997-10-23Remove stpcpy decl.Jim Meyering
Remove free and malloc decls.
1997-10-13Bracket inclusion of termios.h with #ifdef HAVE_TERMIOS_H.Jim Meyering
Masami Takikawa reported that this is necessary on NeXTStep 3.0 systems.
1997-10-07update bug-reporting addressJim Meyering
1997-09-14(struct col_info) [valid_len]: Rename from `valid' which conflictedJim Meyering
with the macro in locale.h of SunOS4.1.4.
1997-09-14(print_horizontal): Add some non-essential curly braces.Jim Meyering
1997-09-14(print_many_per_line): Add some non-essential curly braces.Jim Meyering
1997-09-02[!STDC_HEADERS]: Declare malloc.Jim Meyering
1997-07-06Add new option: --sort=version (-v).Jim Meyering
1997-07-06(print_long_format): Reflect changes in semantics of getuser, getgroup.Jim Meyering
1997-06-22Use variable width columns when printing in multi-column mode.Jim Meyering
(init_col_info): New function. (print_current_files): Call init_col_info if format is `many_per_line' or `horizontal'. (print_many_per_line): Calculate optimum column widths. (print_horizontal): Likewise. From Ulrich Drepper.
1997-05-25declare strip_trailing_slashesJim Meyering
1997-05-25(convert_blocks): Add definition.Jim Meyering
1997-03-10(decode_switches): Ignore value of COLUMNS envionmentJim Meyering
variable when it is the empty string. Suggestion from Ulrich Drepper.
1997-02-20(main): Remove trailing slashes from command line arguments.Jim Meyering
Otherwise, running `mkdir x; chmod 644 x; ls -d x/' (note the trailing slash) makes ls fail with permission denied on at least Linux 1.2.13 and 2.0.14 systems.
1997-02-09update copyrights for 1997Jim Meyering
1997-02-06(quote_filename): Allocate two more bytes (for quotes)Jim Meyering
when using --quote-name (-Q). Feb 2 change wasn't complete. Patch from Mark Harris.
1997-02-03(quote_filename): Don't backslash-escape double quotes.Jim Meyering
This fixes a problem whereby columns weren't aligned when some files contained double quote characters and ls's --escape (-b) option was used. Reported by Mark Harris.
1997-02-02[obstack_chunk_alloc]: Define to malloc, not xmallocJim Meyering
to work better with new obstack functions.
1997-02-01bracket bug address with <> and append a periodJim Meyering
1997-02-01Compare getopt_long return value against -1, not EOF. Use NULL, not '(int ↵Jim Meyering
*) 0' as last parameter in getopt_long call.
1997-01-28(print_long_format): Fix off-by-one problem in size being passed to strftime.Jim Meyering
1997-01-26Restore dcl of free. with obstacks, you need it.Jim Meyering
1997-01-15[!STDC_HEADERS]: Remove unnecessary declaration of free.Jim Meyering
1997-01-09(print_long_format): Cast alloca return value to char*.Jim Meyering
1997-01-05(print_long_format): Detect and handle strftime failureJim Meyering
due to pathologically long strings in locale tables. Patch from Paul Eggert. (print_long_format): Change references to BIGBUF in use of FPUT macro to references to BUF. Use 11 (not 20) bytes for mode string buffer.
1997-01-05(print_long_format): NUL-terminate line of output.Jim Meyering
1997-01-05(print_long_format): First patch from Paul Eggert.Jim Meyering
1997-01-05(print_long_format): Clean up vestiges of legacyJim Meyering
ctime-oriented code. With internationalization and strftime, you can't presume that %a expands to a 3-byte string. Reported by Ross Ridge.
1996-12-29Two problems fixed by these changes from Joakim Rosqvist.Jim Meyering
Quoting Joakim: 1) The "total" number and the size of the first file as output from 'ls --color -s' did not get colorized according to the "no"-argument in LS_COLORS. Fixed by adding a function prep_non_filename_text which prints the C_LEFT C_NORM C_RIGHT strings (or C_END). It is called from main before any text is output, and from print_name_with_quoting after having output a colorized filename. 2) If the "no"-argument of LS_COLORS is set, the terminal will be set to print in that color after ls exits. The man-pages suggests setting "no" and "fi" to the terminals default colors to avoid the problem, but that would mean I can't use anything but the default color for regular files and non-filename text. Fixed by outputting C_LEFT immediately followed by C_RIGHT right before exit, which restores the default color.
1996-12-28Correct obsolete comment referring to macro that is now ls_mode.Jim Meyering
1996-12-19(gobble_file): Stat symlinks also when printing withJim Meyering
color and set linkok to reflect existence of referent. Patches from Joakim Rosqvist, James Antill, and Jesse Thilo.
1996-12-04(print_color_indicator): Initialize EXT to NULL.Jim Meyering
1996-12-03(print_color_indicator): Check the file's suffix onlyJim Meyering
if it's a regular file. (print_type_indicator): Use S_IXUGO instead of writing out (S_IEXEC | S_IXGRP | S_IXOTH). (length_of_file_name_and_frills): Likewise.
1996-11-30(main): Close stdout and check result, in case any deferred writes fail.Jim Meyering
Use EXIT_SUCCESS and EXIT_FAILURE in exit and usage calls.
1996-11-23(usage): Alphabetize option descriptions the way sort -f would.Jim Meyering
1996-11-03change bug-reporting addressJim Meyering
1996-11-02change bug-reporting addressJim Meyering
1996-11-02(gobble_file): Set linkok for non-orphaned symlinks.Jim Meyering
From Bauke Jan Douma. (gobble_file): Initialize linkok. With these two changes, ls --color should display orphaned symlinks as blinking text on terminals that support it.