Age | Commit message (Collapse) | Author |
|
a file is in the future, by looking at high-resolution time
stamps if available.
(TIMESPEC_NS): New macro.
(current_time): Initialize to the minimum value.
(current_time_ns): New var.
(main): Do not bother to initialize current_time;
it's no longer needed.
(get_current_time): New function.
(print_long_format): Use it when a file appears to be in the future.
Get the nanoseconds of the file's time stamp, if available,
and use that to decide whether the file appears to be in the future.
|
|
|
|
bug: the initial byte passed to strftime wasn't initialized to
a nonzero value after the buffer was reallocated.
|
|
|
|
not plain gettext, to get the translations of time formats.
|
|
(print_long_format): Use it, so that we don't assume a
particular width for time stamps in an internationalized
environment.
|
|
(LONGEST_INTEGRAL_TYPE): Remove definition.
(MAX_INTEGRAL_TYPE_SIZE): Use ulonglong_t instead of LONGEST_INTEGRAL_TYPE.
(print_long_long): Compile this function even on systems without
long long support.
(decode_one_format): Remove #if directive.
|
|
`#if HAVE_UNSIGNED_LONG_LONG'. From Darren Salt.
Change all `#ifdef HAVE_UNSIGNED_LONG_LONG' to use `#if' instead.
|
|
|
|
Report the year for files even slightly in the future.
Avoid overflow problems near Y2038 on 32-bit hosts.
To calculate "six months", take half the average Gregorian
year, not 180 days.
|
|
instead of once for each file.
(long_time_format): New var.
(decode_switches): Initialize it, if format == long_format.
(print_long_format): Use it.
|
|
|
|
|
|
(same_file_ok): Use stat only if lstat reported that
the file was a symbolic link.
|
|
|
|
|
|
s/tmp_dst_sb/tmp_src_sb/.
|
|
|
|
tmp_dst_sb, instead of two static vars.
Likewise for tmp_src_sb.
|
|
variables: src_sb_no_link, dst_sb_no_link.
|
|
the suffix `S' wasn't used.
(main): Actually use the local variable, `backup_suffix_string'.
|
|
or `false', rather than relying on implicit int-to-enum cast.
|
|
(gobble_file): Move decl of local, val, into the scope where it's used.
|
|
|
|
|
|
that would use the PPC mfspr `asm' code.
|
|
|
|
|
|
(SORTALLOC, mergealloc, LINEALLOC): Remove.
(sortalloc): Default to zero at program startup.
(SORTALLOC_MIN, SORTALLOC_DEFAULT_MIN): New macros.
(usage, main): Add support for new -S SIZE option.
(specify_sort_size, default_sort_size): New functions.
(initlines): Do not let alloc exceed limit.
(findlines): Likewise.
(checkfp, mergefps, sort): Use sortalloc to size everything
else, instead of relying on precomputed sizes.
|
|
(uid_to_name): Use it.
(gid_to_name): Use it.
Rename locals, user/group, to uid/gid.
|
|
|
|
|
|
|
|
|
|
|
|
Rename change_symlinks member to `dereference' and use the DEREF_*
enum values.
(describe_change): Merge the chgrp and chown switch statements.
Use xmalloc to form the `user:group' string.
(change_file_owner): Record (and later, use) is_symlink and is_directory
from the lstat stats, in order to control whether we operate on symlinks
and whether (with -R) we traverse symlinks to directories.
When dereferencing, use open/fchown (rather than chown) on symlinks.
|
|
|
|
|
|
[enum Change_status, enum Verbosity]: Remove declarations.
Remove decls of globals that are now part of struct Chown_option.
Remove decl of xstat.
(describe_change): Remove function.
(change_file_group): Likewise.
(change_dir_group): Likewise.
(parse_group): Don't set global, groupname, here...
(main): ... instead, initialize `chopt.group_name' here.
Initialize chopt and update uses of the now-members.
Set group_name also when it's obtained via a --reference=FILE option.
Call change_file_owner (with -1 for uids), not change_file_group.
|
|
|
|
[!_POSIX_VERSION]: Declare getgrnam and getgrgid.
(gid_to_name): New function.
(uid_to_name): Likewise.
(chopt_free): Likewise.
|
|
Include chown-core.h.
[enum Change_status, enum Verbosity]: Remove declarations.
Remove decls of globals that are now part of struct Chown_option.
(describe_change): Remove function.
(change_file_owner): Likewise.
(change_dir_owner): Likewise.
(main): Initialize chopt and update uses of the now-members.
Set user_name and group_name also when they're obtained via a
--reference=FILE option.
Pass `chopt' to change_file_owner.
|
|
|
|
|
|
bits, since calling chown resets them on some systems.
Reported by Matt Perry.
|
|
(main): Use dir_name rather than the underlying dir_name_r.
The former now handles cwd-relative names with drive-letter prefixes.
|
|
|
|
(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.
|
|
to avoid uninitialized memory reference via FILE_HAS_ACL.
|
|
|