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

2500 Commits

Author SHA1 Message Date
Jim Meyering 0d7fe8a4de (do_move): Remove lots of code that was duplicated in
copy.c (copy), now that copy() has better support for mv.  This fixes
a bug with cross-filesystem `mv -i' whereby you could get two prompts
for the same destination file and eventually remove the destination
file even though one of the responses was negative.
Reported by Dirk Lattermann.
1998-05-11 04:12:51 +00:00
Jim Meyering 859bfc78b1 reflect additional parameter to copy
initialize new member: move_mode.
1998-05-11 04:07:16 +00:00
Jim Meyering 21ae3d911c (copy_internal): Use new move_mode member.
Add parameter.
(copy): Add parameter.
1998-05-11 04:06:22 +00:00
Jim Meyering 4520ff31e2 Better support for mv:
[struct cp_options] (move_mode): New member.
1998-05-11 04:04:16 +00:00
Jim Meyering 4cc5661b42 (cp_option_init): s/use_mode/set_mode/ 1998-05-10 12:22:58 +00:00
Jim Meyering 19a98e3edc (cp_option_init): Likewise.
(main): Set new preserve_* options.
1998-05-10 12:22:23 +00:00
Jim Meyering 50e17793c8 (cp_option_init): Initialize new members. 1998-05-10 12:19:30 +00:00
Jim Meyering 8a0a50e6b0 (new_nondir_mode): New function. Use where appropriate.
Use more-specific preserve_* members in place of removed `preserve'.
(copy_internal): Honor failed_unlink_is_fatal.
1998-05-10 12:18:21 +00:00
Jim Meyering a42054dd57 Support for install:
[struct cp_options] (failed_unlink_is_fatal): New member.
(preserve_owner_and_group): New member.
(preserve_chmod_bits): New member.
(preserve_timestamps): New member.
(preserve): Remove member.
(set_mode): New member.
(mode): New member.
1998-05-10 12:17:46 +00:00
Jim Meyering 24da56f990 (main): Rewrite argv-handling to be clearer.
(copy_file): Rewrite to use copy.c (copy).
(change_attributes): Get rid of now-(with chown wrapper)-unnecessary
`no_need_to_chown' parameter.  Fix caller.
(install_file_in_file): Remove now-unnecessary `to_created' parameter.
(cp_option_init): New function.
Update several functions to take new parameter specifying copy options.
1998-05-10 03:05:44 +00:00
Jim Meyering 83c2cfa04d Include safe-read.h.
Don't declare safe_read.
1998-05-09 17:42:50 +00:00
Jim Meyering 53c7a54a58 Include safe-read.h.
Don't declare safe_read.
1998-05-09 17:41:37 +00:00
Jim Meyering bbf4d37373 (tac_seekable): Rename from tac_stream.
Change `FILE *in' parameter to `int input_fd'. Adjust callers.
Revert to using safe_read -- can't mix lseek and fread.
And can't use fseek because it can't handle files larger than 2^32.
1998-05-09 14:42:31 +00:00
Jim Meyering 9bb85624cf fix up compile warnings 1998-05-07 17:45:10 +00:00
Jim Meyering 9b5402ec48 Don't use safe_read. Use fread instead.
Fix open and fdopen to agree that file is read/write: O_RDWR and "w+".
This is required on at least solaris5.5.1.
1998-05-07 17:43:13 +00:00
Jim Meyering 77728e4f4b add curlies 1998-05-07 16:01:02 +00:00
Jim Meyering 9db889c372 add some curly braces 1998-05-07 15:55:56 +00:00
Jim Meyering caace05438 rename variable 1998-05-07 15:54:44 +00:00
Jim Meyering cd7f8d6e9b (tac_stdin): Use STDIN_FILENO rather than literal `0' in fstat call. 1998-05-07 15:50:54 +00:00
Jim Meyering 3954a4f441 remove dcl of unused safe_read 1998-05-04 00:44:37 +00:00
Jim Meyering 45af919ce6 (check_format): Use ISDIGIT, not isdigit. 1998-05-02 15:36:43 +00:00
Jim Meyering 2e97d27586 (parse_line): Use ISSPACE, not isspace.
Use unsigned char * pointers, not potentially signed ones, to avoid
sign extension.
1998-04-28 13:09:47 +00:00
Jim Meyering fef313b2b0 Remove definition of _GNU_SOURCE 1998-04-27 04:31:45 +00:00
Jim Meyering d5d061ee9b (keycompare): Don't return 0 from inside the keyspec-iterating loop.
With this change, test 22a passes.  Reported by Zvi Har'El.
1998-04-27 04:29:05 +00:00
Jim Meyering b44e91e99d (strncoll): Remove bogus assertion. 1998-04-27 03:50:17 +00:00
Jim Meyering 808b938840 Don't define NDEBUG. 1998-04-26 20:42:16 +00:00
Jim Meyering 83d4d74a88 Don't define NDEBUG. 1998-04-26 20:41:42 +00:00
Jim Meyering 0d38a270a4 Do not define _GNU_SOURCE and/or NDEBUG 1998-04-26 20:38:28 +00:00
Jim Meyering 3f017c26ca [struct File_spec] (pretty_name): Remove member.
(pretty_name): New function.
1998-04-26 20:09:26 +00:00
Jim Meyering 7dd872d963 Remove usage-like comments near beginning of file. 1998-04-26 19:58:43 +00:00
Jim Meyering b7d50ca523 (xwrite): New function -- converted from macro. 1998-04-26 19:53:54 +00:00
Jim Meyering fe18d63a65 (close_fd): New function -- converted from macro.
[struct File_spec] (n_stat_calls): New member.
[struct File_spec] (n_unchanged_stats): New member.
(max_n_unchanged_stats): New global.
Initialize new members.
1998-04-26 19:50:21 +00:00
Jim Meyering d738449858 (md5_check): Declare local, `md5num' as _unsigned_ char*.
(hex_digits): Declare parameter `s' as _unsigned_ char*.
(split_3): Declare parameter `u' as _unsigned_ char**.
1998-04-26 15:28:06 +00:00
Jim Meyering 7254d243f2 (print_nth_dir): Remove first (and always-true) part of conjunct in assertion. 1998-04-26 05:14:50 +00:00
Jim Meyering 1187f5eb7f (xfields): Used unsigned char* pointers to avoid 1998-04-17 15:37:29 +00:00
Jim Meyering 5bcc1fd7fd (check_punctuation): Used unsigned char* pointers to avoid 1998-04-17 15:37:03 +00:00
Jim Meyering 713c315978 Use STREQ in string equality tests, not strcmp. 1998-04-14 15:17:32 +00:00
Jim Meyering 48990a9078 Include safe-read.h instead of merely declaring safe_read. 1998-04-12 19:56:25 +00:00
Jim Meyering d4257e63c7 Use STREQ rather than strcmp 1998-04-12 09:27:45 +00:00
Jim Meyering 7154d646cb (wc): Declare per-file counters and `linepos' to be of type uintmax_t.
Declare bytes_read to be ssize_t.
1998-04-12 09:12:21 +00:00
Jim Meyering b388203a65 Include safe-read.h instead of merely declaring safe_read. 1998-04-11 18:24:09 +00:00
Jim Meyering 66c7b3c41d Include safe-read.h instead of merely declaring safe_read. 1998-04-11 18:23:13 +00:00
Jim Meyering ac7b3c4fa9 [HAVE_INTTYPES_H]: Include inttypes.h.
Declare counters to be of type uintmax_t.
(write_counts): Use human_readable to format potentially-long-long
numbers.  Suggestion from Rogier Wolff.
1998-04-11 18:21:24 +00:00
Jim Meyering dddfcab3b3 *** empty log message *** 1998-04-11 09:24:28 +00:00
Jim Meyering 7b9c4d3d03 (cph_hash_insert): Rename from now-conflicting hash_insert.
Also declare to be static.
1998-04-06 08:15:29 +00:00
Jim Meyering 3783d6be57 (hash_insert): Remove declaration. 1998-04-06 08:14:58 +00:00
Jim Meyering 632ebfa209 Change names/usage of hash-related functions to work with the above. 1998-04-06 08:11:35 +00:00
Jim Meyering 19fcb4356c Use "%s", not device_name, as the format string, in case the
latter contains `%'.
1998-04-04 16:47:19 +00:00
Jim Meyering 5fbcd963df clean up comments 1998-04-04 10:36:32 +00:00
Jim Meyering 953c42bd52 (valid_options): Parenthesize assignment in while expr.
(main): Remove dcl of unused `cp'.
1998-04-04 09:38:47 +00:00