summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2000-12-08Include xalloc.h.Jim Meyering
(main): Use dir_name rather than the underlying dir_name_r. The former now handles cwd-relative names with drive-letter prefixes.
2000-12-07(address_base): Declare to be static.Jim Meyering
2000-12-07(address_base, address_pad_len): New var.Jim Meyering
(output_address_fmt_string, address_fmt_buffer, address_pad): Remove. (flag_pseudo_start): Now int, not long int. (pseudo_offset): Now off_t, not long int. (n_specs, n_specs_allocated): Now size_t, not unsigned int. (format_address, format_address_none, format_address_std, format_address_label): Now accepts an extra char argument (an extra char to print if nonzero), and prints instead of returning a string. All callers changed. (bytes_per_block): Now size_t, not int. (format_address_none): Do not even print the extra char argument. This simplifies the callers. (format_address_std, format_address_label): Print off_t ourself instead of trying to use autoconfigured format. This is faster and more portable. (format_address_paren): New function. (dump): Remove unnecessary cast. (expand_address_fmt): Remove. (main): Use size_t, off_t, etc. instead of builtin types where this is advisable. Adjust to above changes. Remove unnecessary cast.
2000-12-03(gobble_file) [USE_ACL]: Set have_acl member unconditionallyJim Meyering
to avoid uninitialized memory reference via FILE_HAS_ACL.
2000-12-03remove instrumentationJim Meyering
2000-12-03add instrumentation to detect some UMRsJim Meyering
2000-12-03(tail_file): Initialize ignore, dev, and ino members,Jim Meyering
when tailing forever and the open failed. Otherwise, we could get uninitialized memory references of those fields in recheck.
2000-12-03use CHAR_BIT, not BITSPERBYTEJim Meyering
2000-12-03(CHAR_BIT): Define.Jim Meyering
2000-12-03Make od print valid addresses for offsets of 2^32 and larger. (cont'd)Jim Meyering
(MAX_ADDRESS_LENGTH): Don't hard-code as a literal. Rather, define in terms of the type, off_t. (string_min): Declare to be of type size_t. (flag_dump_strings): Declare to be of type int. (print_s_char): Declare the n_bytes parameter and the local, `i', to be of type off_t. (print_char): Likewise. (print_s_short): Likewise. (print_short): Likewise. (print_int): Likewise. (print_long): Likewise. (print_long_long): Likewise. (print_float): Likewise. (print_double): Likewise. (print_long_double): Likewise. (dump_hexl_mode_trailer): Likewise. (print_named_ascii): Likewise. (print_ascii): Likewise. (write_block): Likewise. (print_ascii): Declare local, `print_function' with a prototype. Change a few `>' comparisons to the equivalent `<' form. (parse_options): Declare `tmp' to be of type uintmax_t. Use xstrtoumax, not xstrtoul. Fail if the specified offset if larger than OFF_T_MAX. (dump_strings): Declare local `i' to be of type size_t. Remove the now-unnecessary cast-to-off_t. (main) [IF_LINT]: Initialize desired_width to avoid a warning. Declare `tmp' to be of type uintmax_t. Use xstrtoumax, not xstrtoul. Fail if minimum string length is larger than SIZE_MAX. Fail if specified width is larger than ULONG_MAX.
2000-12-03(OFF_T_MIN): Remove definition.Jim Meyering
(OFF_T_MAX): Likewise.
2000-12-03(OFF_T_MIN): Define.Jim Meyering
(OFF_T_MAX): Define.
2000-12-03Make od print valid addresses for offsets of 2^32 and larger.Jim Meyering
(format_address): Use off_t, not long unsigned_int as the parameter type. (format_address_none): Likewise. Mark parameter as unused. (format_address_std): Likewise. (format_address_label): Likewise. (print_ascii): Mark format string parameter as unused. (write_block): Use off_t, not long unsigned_int as offset type. (expand_address_fmt): New function. (main): Use it to expand each address format string template. Reported by Mark Nudelman, via Andreas Jaeger.
2000-12-03(parse_options): Use xstrtoumax to parse the byte and lineJim Meyering
offset. Give a better diagnostic when the requested offset is still representable but larger than OFF_T_MAX.
2000-12-02(valid_format): Move pre-increment to a separate statement to avoid a warning.Jim Meyering
2000-12-02Move dcls of globals used only in main...Jim Meyering
(main): ...to here. (usage): Clarify option descriptions.
2000-12-02whoops. rename the use, too -- not just the decl!!Jim Meyering
2000-12-02(checkfp): Rename local `buf' to avoid shadowing previous declaration.Jim Meyering
2000-12-02(skip): Use lseek instead of worrying about fseeko or fseek.Jim Meyering
This should be portable, as we seek before doing any I/O. (fseeko): Remove; no longer used.
2000-12-02add back the parens Paul removed :-)Jim Meyering
2000-12-02(gobble_file): Do not fall back on lstat if statJim Meyering
fails; POSIX.2 does not allow this. Invoke acl only on non-symlinks, and only if lstat or stat succeeds.
2000-12-02(NONZERO): Define and use it to make the code a tinyJim Meyering
bit more readable.
2000-12-02(main): Remove any trailing slash unconditionally.Jim Meyering
Reported by Volker Borchert.
2000-12-02(skip, dd_copy): Use ssize_t to store result ofJim Meyering
safe_read, to avoid overflow e.g. on 64-bit Solaris sparc. (dd_copy): Remove unnecessary cast.
2000-12-02Undo most of the changes since 2000-11-24, since we'veJim Meyering
documented a standard way to do it. (skip_bytes, seek_bytes): Remove. (usage): Remove B suffix. (scanargs, skip, dd_copy, main): Remove support for B suffix.
2000-11-30s/SIZE_T_MAX/SIZE_MAX/.Jim Meyering
2000-11-30Include <stdint.h> if HAVE_STDINT_H.Jim Meyering
(SIZE_MAX): Renamed from SIZE_T_MAX, as C99 uses SIZE_MAX. All uses changed.
2000-11-30(SIZE_T_MAX): Define.Jim Meyering
2000-11-30Port GNU "sort" to hosts where sizes don't fit in "int",Jim Meyering
e.g. 64-bit Solaris (sparc). ("human.h", "xstrtol.h"): Include. (struct line): length member is now size_t, not int. (struct lines): Likewise for used, alloc, limit members. (struct buffer): Likewise for used, alloc, left, newline_free members. (struct keyfield): Likewise for sword, schar, eword, echar members. (sortalloc, mergealloc, linelength): Now size_t, not int. (initbuf, fillbuf, initlines, begfield, limfield, findlines, numcompare, getmonth, keycompare, compare, checkfp, mergefps, sortlines, sort): Accept, return, and use size_t for sizes, not int. (fillbuf, initlines, findlines, checkfp, sort): Check for overflow when computing buffer sizes. (begfield, limfield): Do not index past end of array. (checkfp): Return a boolean, not a line number, as the line number may not fit in int. All callers changed. Use uintmax_t for line numbers, not int. (sort): Don't allocate tmp until we need it (and know the right size). (parse_field_count): New function. (main): Use it to check for overflow in field counts. "outfile" is now a pointer to const.
2000-11-26Include config.h, stdio.h, sys/types.h. and system.h here instead.Jim Meyering
2000-11-26Include config.h, stdio.h, sys/types.h. and system.h here instead.Jim Meyering
2000-11-26don't include system.h hereJim Meyering
2000-11-26(skip): Perform the `records < blocksize' testJim Meyering
at the top of the loop, not at the bottom.
2000-11-26(skip): New arg COUNT_BYTES. Read with BLOCKSIZEJim Meyering
bytes, but consider RECORDS to be a byte count if COUNT_BYTES is nonzero.
2000-11-26(skip_bytes, seek_bytes): Now booleans, not counts.Jim Meyering
(seek_records): Renamed from seek_record, for consistency with skip_records and max_records. All uses changed. (usage, scanargs): Remove bseek=n and bskip=n; instead, use seek=nB and skip=nB. (enum Unit, Unit): Remove. (skip, dd_copy, main): Undo most recent change. (dd_copy, main): Pass blocksize of 1 as appropriate when skip_bytes or seek_bytes is nonzero. (main): Rework ftruncate failure diagnostic to always use byte count.
2000-11-25more post-merge clean-up.Jim Meyering
Fix a merge bug exposed by new test.
2000-11-25remove bskipJim Meyering
adapt skip to skip either by bytes or by blocks
2000-11-25(S_TYPEISSHM): New macro.Jim Meyering
(main): Report failed fstat. Complain only when ftruncate fails on a regular file, a directory, or a shared memory object.
2000-11-24bskip/bseek patch from Chris Sylvain <csylvain@umm.edu> merged inJim Meyering
2000-11-24Declare a pointer parameters to be `const' as appropriate.Jim Meyering
2000-11-24(main): Use ftruncate only on regular files.Jim Meyering
Based on a patch from Michael Stone. Reported by andras@kolumbus.fi at http://bugs.debian.org/77174.
2000-11-23(show_point): Before accepting an entry as a match, make sure thatJim Meyering
the mount directory exists and has the required device number. Before, e.g., `df /floppy' would mistakenly report on the root partition if /floppy were not listed in /etc/mtab but / was. Patch from Eirik Fuller (http://bugs.debian.org/76923).
2000-11-23(mode_changed): New function.Jim Meyering
(change_file_mode): Use it to determine accurately when -c should make chmod announce there's been a change.
2000-11-19(main): Do not assume EOF == -1.Jim Meyering
Handle the case correctly when digits options immediately precede a non-option.
2000-11-19(BLOCK_SIZE_OPTION, COLOR_OPTION, FORMAT_OPTION,Jim Meyering
INDICATOR_STYLE_OPTION, QUOTING_STYLE_OPTION, SHOW_CONTROL_CHARS_OPTION, SORT_OPTION, TIME_OPTION): New enum values, to ensure that option values can't collide with chars. (long_options, decode_switches): Use them.
2000-11-19(GETOPT_HELP_CHAR, GETOPT_VERSION_CHAR): Now enumJim Meyering
constants rather than macros. Use values that cannot conflict with C characters or with -1, CHAR_MAX + 1, etc.
2000-11-18(count_entry): Don't omit the size of a directory entryJim Meyering
merely because we couldn't `chdir' into it. That would give subtly different results in some cases. Reported by Mattias Wadenstein via Michael Stone.
2000-11-18Revert change of 2000-11-11. It inadvertently changeJim Meyering
the output format of `ls -l --full-time'.
2000-11-18(main): When failing to create a directory, give onlyJim Meyering
one diagnostic, not two. Reported by Volker Borchert.
2000-11-18(main): With --parents, remove any trailing slashesJim Meyering
from the argument to the final mkdir call. Required for NetBSD.