1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-06-08 18:56:40 +02:00
Commit Graph

1266 Commits

Author SHA1 Message Date
Jim Meyering 25ec733e8d Include xstrtoul.h.
Remove global variable, unit_size.
(atou): Remove now-unused function.
(parse_unit): Likewise.
(string_to_ull): New function.
(head): Take new parameter, count_lines.  Use it instead of unit_size.
Update callers.
(head_file): Likewise.
(main): Use string_to_ull, not atou/parse_unit.
1997-07-13 21:59:34 +00:00
Jim Meyering b05ff2249b Rename lots of `this' locals.
Make some parameters `const'.
(who): Update read_utmp caller.
(search_entries): Take additional param: utmp_buf.
Update read_utmp caller.
(who_am_i): Update read_utmp caller.
1997-07-13 04:13:40 +00:00
Jim Meyering 7fe4db1451 (users): Update read_utmp caller. 1997-07-13 03:57:00 +00:00
Jim Meyering 393e4a8c36 (uptime): Update read_utmp caller. 1997-07-13 03:56:29 +00:00
Jim Meyering 6e1340462e Add FIXME.
indent
1997-07-13 03:13:09 +00:00
Jim Meyering aeea923e99 indent 1997-07-13 03:10:15 +00:00
Jim Meyering d461077920 indent 1997-07-13 03:08:45 +00:00
Jim Meyering d0c515b45c indent 1997-07-13 03:07:36 +00:00
Jim Meyering 4b84ea8745 indent 1997-07-13 02:58:35 +00:00
Jim Meyering ad0f8c9b71 (uptime): rename users to n_users 1997-07-13 02:52:58 +00:00
Jim Meyering 67fe78f11c declare xmalloc
(users): rename users to n_users
1997-07-13 02:52:24 +00:00
Jim Meyering b18c5abf1c (who): rename users to n_users 1997-07-13 02:51:34 +00:00
Jim Meyering 59f66af0f4 . 1997-07-13 02:49:39 +00:00
Jim Meyering 4cf5b77561 . 1997-07-13 02:19:46 +00:00
Jim Meyering 65738c9162 . 1997-07-13 02:18:14 +00:00
Jim Meyering 6341f011d7 . 1997-07-13 02:17:51 +00:00
Jim Meyering d1a07e1ad2 (MAYBE_SET_TZ_UTC0): New macro.
(set_tz): New function.
(batch_convert): If necessary, save the initial value of TZ and
for each date in the file, restore it before each call to get_date,
then set it to UTC0 before each show_date call.
(main): Don't set TZ before calling get_date.
Set TZ after get_date call and before show_date call.
Reported by Matthew Braun.
1997-07-12 22:52:57 +00:00
Jim Meyering 83c3f08048 declare stpcpy 1997-07-06 21:24:10 +00:00
Jim Meyering d0caad54ae Add new option: --sort=version (-v). 1997-07-06 21:23:42 +00:00
Jim Meyering 2b0ecc7fa5 (print_long_format): Reflect changes in semantics of getuser, getgroup. 1997-07-06 13:51:16 +00:00
Jim Meyering 08f38fd930 (parse_obsolescent_option): If POSIXLY_CORRECT is set, give
a diagnostic and fail when there are two or more non-option arguments.
1997-07-05 22:50:32 +00:00
Jim Meyering ac0ee614d6 Redefine/undef getusershell around inclusion of <unistd.h>
(via system.h) so Cray's int-returning prototype doesn't conflict
with our char*-returning one.
1997-07-05 08:25:58 +00:00
Jim Meyering 22ff29fe3e (apply_attributes): New function.
(copy_reg): Use apply_attributes instead of open-coding the pieces.
Now, failure to preserve file attributes does not cause mv to change
its exit status, and such failures elicit warning diagnostics.  This
behavior is required by POSIX.  Before, failure to preserve ownership
due to insufficient access was diagnosed only for root.
Prompted by a report from Bengt Martensson.
1997-07-03 12:16:41 +00:00
Jim Meyering 7a280a0fda (STRTOX): Convert function header in macro definition
to K&R-style.  Otherwise, ansi2knr would fail to convert the function
definitions to K&R for old style compilers.  From Kaveh Ghazi.
1997-07-02 16:07:44 +00:00
Jim Meyering 6ad0d51107 (copy): Add FIXME comment. 1997-06-29 22:24:26 +00:00
Jim Meyering dc404c4107 (copy_reg): New parameter, SOURCE_STATS.
(do_move): Update caller.
(movefile): Take new boolean parameter, DEST_IS_DIR,
to save a stat per moved file when the destination is a directory.
(main): Call movefile with additional argument.
(strip_trailing_slashes_2): New function.
(movefile): Remove trailing slashes from dest.  Otherwise, stat ("b/")
fails with ENOTDIR on systems including Linux w/libc 2.0.30.
Reproduce with `rm -rf a b; mkdir a; touch b; ./mv a b/'.
(do_move): Fix misleading comment.
1997-06-29 22:21:42 +00:00
Jim Meyering a13135d09e Move the OPENOPTS def from end to beginning of else clause so it's closer
to the one in the then clause.
1997-06-29 01:56:36 +00:00
Jim Meyering f657d65570 update from automake-1.2 1997-06-25 17:05:56 +00:00
Jim Meyering 6700c89ac7 Use variable width columns when printing in multi-column mode.
(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-06-22 19:52:24 +00:00
Jim Meyering a6526f2171 (eval6): Accept new unary operator, quote.
From Karl Heuer.
1997-06-16 17:01:24 +00:00
Jim Meyering 952a76e506 tweak error message 1997-06-16 16:12:04 +00:00
Jim Meyering 50e65a424c (init_header) [T_BUF_FMT]: Output the 4-digit year (not the
2-digit abbreviation) in each page header.  Reported by Noah Friedman.
1997-06-15 11:40:47 +00:00
Jim Meyering 2f1768f676 (cut_fields): Detect when the input is empty and handle
that special case.  Before `cut -f1 </dev/null' would improperly
output a single newline.  Reported by Phil Richards.
1997-06-14 17:31:40 +00:00
Jim Meyering 9fb965dfd8 Add comment for posixly_correct. 1997-06-12 11:47:34 +00:00
Jim Meyering 8406b91aba (docolon): Test (re_buffer.re_nsub > 0) rather than
searching for `\(' to determine whether to return 0 or the empty
string.  Before it would improperly return '' if the pattern
contained a substring like this: `\\('.  From Karl Heuer.
For example, running expr c : '\\(' should print `0'.
1997-06-11 20:18:15 +00:00
Jim Meyering 94468e0921 indent cpp directives 1997-05-29 13:20:25 +00:00
Jim Meyering 4377246ee3 update from automake-1.1p 1997-05-29 13:19:34 +00:00
Jim Meyering e4f25ca7b1 Use base_name, not basename. 1997-05-27 13:55:23 +00:00
Jim Meyering bc50ceb474 clean up for -Wall 1997-05-27 11:05:40 +00:00
Jim Meyering 4c2adcbd56 Use base_name, not basename. 1997-05-27 11:04:41 +00:00
Jim Meyering f0c27dac9e Use base_name, not basename.
Use X, not CP_OPTIONS.
1997-05-27 11:00:50 +00:00
Jim Meyering 8805ede31b (copy_internal): When preserving symlinks (--no-dereference) and the
destination file is a symlink, use stat (not xstat) to see if it points
back to the source.  Reported by James <james@albion.glarp.com>.
1997-05-26 04:46:47 +00:00
Jim Meyering a65a081656 declare strip_trailing_slashes 1997-05-25 21:25:28 +00:00
Jim Meyering 0cc1681a5b Remove global variable opt_human_readable.
(enum Output_units): Rename from output_size.
Rename size_* to Unit_*.
Add Unit_variable to correspond to --human-readable.
(convert_blocks): Remove now-unused definition.
(human_readable): Rename paramater n_bytes to n_blocks.
Adjust conversions to reflect fact that input is now number of
512-byte blocks, not bytes.
(print_size): New function.
(du_files): Use print_size instead of open coding it.
(count_entry): Always count in units of 512-byte blocks to delay.
This lets du accumulate totals corresponding to a terabyte before
overflowing 32-bit long int.
Use print_size instead of open coding it.
1997-05-25 21:23:15 +00:00
Jim Meyering 07876bcb5d (convert_blocks): Add definition. 1997-05-25 15:10:03 +00:00
Jim Meyering 11080b7544 (convert_blocks): Remove definition.
Indent cpp directives.
1997-05-25 14:22:55 +00:00
Jim Meyering 1b71b3372e (convert_blocks): Remove now-unnecessary #undef.
(du_files): Pass output_size unchanged to convert_blocks.  No need
to test output_size for size_bytes, convert_blocks handles that
correctly.
(count_entry): Likewise.
1997-05-25 14:21:41 +00:00
Jim Meyering 1ba34180d7 (main): Implement new --max-depth=N option.
Based on the idea and a patch from Torbjorn Lindgren.
(du_files): Likewise.
(count_entry): Likewise.
[AIX]: Remove unused #pragma alloca.
1997-05-25 14:11:50 +00:00
Jim Meyering 54a61c3cf6 Remove FIXME.
Add spurious curlies and an empty line.
1997-05-25 13:00:01 +00:00
Jim Meyering 6919955eb1 New options: --ignore-fail-on-non-empty and --verbose.
(remove_parents): Implement new options.
(main): Likewise.
1997-05-25 03:46:46 +00:00