?? changelog
字號:
* src/ls.c: Likewise.2001-11-24 Jim Meyering <meyering@lucent.com> * Makefile.maint: Include signatures for the xdelta file, too. * Makefile.maint (emit-upload-commands): Rename from emit-rsync-commands. Output only the package name and the prev and current version numbers. * Version 4.1.2. * src/sync.c (usage): Make --help and --version strings start in column 7. * Makefile.cfg (move_if_change): Remove definition. ($(srcdir)/m4/jm-glibc-io.m4): Use mv, not move-if-change.2001-11-23 Jim Meyering <meyering@lucent.com> * cp.c, df.c, du.c, install.c, ln.c, ls.c, mkdir.c (usage): * mkfifo.c, mknod.c, mv.c, shred.c, touch.c (usage): Note that ``Mandatory arguments to long options are mandatory for short options too.'' * src/shred.c (usage): Use `output', not `print' in description of the --version option, so this message is consistent with all the rest. * chgrp.c, chmod.c, chown.c, cp.c, dd.c, df.c, dircolors.c (usage): * du.c, install.c, ln.c, ls.c, rm.c, rmdir.c, shred.c, touch.c (usage): Split --help output into smaller pieces. Use fputs, not printf. * src/cp-hash.c: Use opaque type, Hash_table, not `struct hash_table'. * src/du.c: Likewise. * src/remove.c: Likewise.2001-11-22 Jim Meyering <meyering@lucent.com> Don't fail for commands like this: cp a a d/ This change in behavior was introduced in 4.1.1, as part of the 2001-09-28 change. cp and mv still fail for commands like this: rm -rf a b c; mkdir a b c; touch a/f b/f; mv a/f b/f c * src/copy.c (triple_hash_no_name): New function. (src_info_init): New function. (copy_internal): Warn and return early for the second and subsequent occurrences of the same source file named on the command line. * src/copy.h (struct cp_options) [src_info]: New member. * src/install.c (cp_option_init): Initialize new member. * src/mv.c (cp_option_init): Likewise. * src/cp.c (cp_option_init): Likewise. (do_copy): Call src_info_init. * tests/mv/dup-source: New test for the above. * tests/mv/Makefile.am (TESTS): Add dup-source. * src/copy.c (seen_file): Change type of `stats' parameter to pointer. (copy_internal): Update caller. * src/copy.c (struct F_triple): Rename from dest_info. (seen_file): Rename from seen_dest. Rename parameters accordingly. (record_file): Rename from record_dest. Rename parameters accordingly. (triple_hash): Rename from dest_info_hash. (triple_compare): Rename from dest_info_compare. (triple_free): Rename from dest_info_free. * src/mknod.c (main): Add a literal format string to suppress a warning from gcc's -Wformat-security. copy.c shouldn't maintain static state. * src/copy.c (dest_info): Remove declaration of file-scoped global. (dest_info_init): Require a parameter. Update all callers. (seen_dest): Require a hash table parameter. Update callers. (record_dest): Likewise. * src/copy.h: Include hash.h. (struct cp_options) [dest_info]: New member. * src/install.c (cp_option_init): Initialize new member. * src/mv.c (cp_option_init): Likewise. * src/cp.c (cp_option_init): Likewise. (do_copy): Remove const attribute from declaration of parameter, x.2001-11-17 Jim Meyering <meyering@lucent.com> * tests/chmod/equals: New test for the just-fixed bug in lib/modechange.c. * tests/chmod/Makefile.am (TESTS): Add equals. * configure.ac: Replace use of the one-arg form of AC_INIT with a use of the 3-arg form and a use of AC_CONFIG_SRCDIR.2001-11-12 Jim Meyering <meyering@lucent.com> * tests/rm/r-3: Clean up.2001-11-09 Jim Meyering <meyering@lucent.com> * configure.ac: Use AC_CONFIG_FILES(...) and call AC_OUTPUT with no arguments.2001-11-06 Jim Meyering <meyering@lucent.com> * src/dircolors.hin: Remove duplicate entry for .png. Reported by Fr閐閞ic L. W. Meunier.2001-11-03 Jim Meyering <meyering@lucent.com> * Version 4.1.1. * src/ls.c (DEV_INO_PUSH): Avoid unnecessary copies. (dev_ino_pop): Likewise.2001-11-02 Jim Meyering <meyering@lucent.com> * src/ls.c: Rename global: s/trace_dirs/recursive/. (extract_dirs_from_files): Rename parameter: s/recursive/ignore_dot_and_dot_dot/. * src/ls.c: (dev_ino_pop): Cast 2nd arg of obstack_blank to `int' before negating to avoid warning from gcc on systems with 64-bit size_t. * src/ls.c: Use XMALLOC and XREALLOC in a several places. It's cleaner.2001-11-01 Jim Meyering <meyering@lucent.com> * src/ls.c: Include dirfd.h. (print_dir): If dirfd fails, resort to using stat. * tests/ls/infloop: Redirect cmp's stderr to /dev/null. * src/ls.c (struct pending) [st_ino, st_dev]: Remove members. (queue_directory): Remove just-added 3rd parameter and associated code, and update callers. (print_dir): Get dev/inode pair via `fstat (dirfd (reading), ...', and call visit_dir to detect cycles here. Push the dev/inode pair onto the new stack. (dev_ino_obstack): New global. (DEV_INO_PUSH): New macro. (dev_ino_pop): New function. (ASSERT_MATCHING_DEV_INO): New macro. (visit_dir): Take two parameters (dev,ino), not one `pending'. (main): Initialized the dev_ino_obstack. Don't call visit_dir here. Get the dev/ino pair from the new stack, not from the pending entry. Make ls -R detect directory cycles. Add loop detection without incurring an additional stat call per directory processed. To detect loops efficiently (i.e., time: +O(1) per directory processed by ls -R, total additional space: O(max-tree-depth)), record the dev/ino of each `active' directory in a hash table. To know when a directory is no longer active, insert a marker (name == NULL) entry for it in the pending queue. When a marker comes to the front of the queue, that directory is no longer active, and must be removed from the hash table. To remove it, we need to know its dev/ino again. Since by the time a directory has become inactive its files[] info is long gone and it's DIR* is closed, I must either save the dev/ino someplace (pending seemed logical) or recompute them via stat. The following change will convert to using a stack of dev/ino pairs instead, pushing an entry when doing the opendir (use fstat on dirfd (reading)), and popping (when encountering a marker) to get the dev/ino pair to be removed from the hash table. * src/ls.c: Include hash.h, same.h, and xalloc.h. (INITIAL_TABLE_SIZE, LOOP_DETECT): Define. (active_dir_set): New global. (struct dev_ino): Declare. (dev_ino_hash, dev_ino_compare, dev_ino_free): New functions. (visit_dir, free_pending_ent): New functions. (main): Initialize the active_dir_set hash table, if necessary. Don't confuse a marker entry with a real one. Detect loops. Manage the set of active directories. Free the hash table. (queue_directory): Add a new parameter. Ensure that we set the new dev/ino members for each enqueued directory. Update all callers. (print_dir): Don't confuse a marker entry with a real one. (extract_dirs_from_files): Insert a marker entry before inserting the entries for subdirectories. Don't try to print a NULL pointer. * src/ls.c (main): Don't use ARGMATCH_TO_ARGUMENT. This reverts part of the 1998-12-31 change. * tests/ls/dired: New test, for the above. * tests/ls/Makefile.am (TESTS): Add dired.2001-10-24 Jim Meyering <meyering@lucent.com> * src/cp.c (main): Free hash table storage. * src/cp-hash.c (forget_all): Use hash_free, not hash_clear.2001-10-22 Paul Eggert <eggert@twinsun.com> * src/sys2.h (alloca): Define to __builtin_alloca if __GNUC__, to avoid a warning if -Wall.2001-10-21 Paul Eggert <eggert@twinsun.com> * src/dd.c: Remove as many instances of 'unsigned' as possible, as some of them were not conforming to ANSI C, and they made the code hard to read. Avoiding 'unsigned' cuts down on the number of casts. (newline_character, space_character, save_char): Now char, not unsigned char. (obuf): Now char *, not unsigned char *. (ascii_to_ebcdic, ascii_to_ibm, ebcdic_to_ascii): Now char[], not unsigned char[]. (translate_charset, translate_buffer, swab_buffer, skip, copy_simple, copy_with_block, copy_with_unblock): Arg now points to char, not unsigned char. All callers changed. (translate_charset, parse_conversion, apply_translations): Use int index, not unsigned int. (bit_count): Arg is now int, not unsigned int. Callers not changed, as they already assumed this. (translate_buffer): Cast char to unsigned char before using it as a subscript. (swab_buffer): Returns char *, not unsigned char *. (dd_copy): Use char, not unsigned char, for buffers. Use size_t for possibly-large index, not unsigned int.2001-10-21 Jim Meyering <meyering@lucent.com> * src/shred.c (isaac_seed_machdep): Handle SIGSEGV, too. Ick. * tests/mv/Makefile.am (TESTS): Remove i-3. It's not portable. * src/copy.c: Include xreadlink.h. (copy_internal): Don't use PATH_MAX. Rewrite the symlink-copying code to use xreadlink.2001-10-20 Jim Meyering <meyering@lucent.com> * src/touch.c (touch): Extend last change to work on systems for which errno is set to EINVAL. * src/ls.c: Declare some local variables to be `const', where appropriate. (usage): Improve the description of --dereference (-L). * src/rm.c (usage): Clarify description of --directory (-d). Based on a patch from Michael Stone. * man/chmod.x: Describe sticky files and directories. From Michael Stone. * tests/mv/partition-perm: Don't use a umask that removes owner read/write. Use a stricter test for permissions. * tests/cp/link-preserve: Don't use a umask that removes owner read/write. That would induce spurious failures in a probably- outdated version of purify.2001-10-18 Jim Meyering <meyering@lucent.com> * src/mv.c (movefile): Now that remember_copied xstrdup's the file name, free `new_dest'. Plug a leak. * src/cp-hash.c (remember_copied): Use src_to_dest_free to free the entry we couldn't insert. Don't use free'd memory. * src/copy.c (dest_info_free): New function. (dest_info_init): Make the hash table code use it. (record_dest): Store each DEST in malloc'd memory. Hence the above. Use dest_info_free to free the `ent' we couldn't insert.2001-10-14 Jim Meyering <meyering@lucent.com> Now, -P is the same as --no-dereference, per POSIX. Use --parents to get the old meaning. * src/cp.c (enum) [NO_DEREFERENCE_OPTION]: Remove member. (long_opts): Associate --no-dereference with `-P'. (usage): Update description of -P. (main): Remove local, used_P_option, and code to warn that the meaning of -P would be changing.2001-10-13 Jim Meyering <meyering@lucent.com> * src/copy.c (copy_internal): Tighten up and add comments describing the test for when to record (via remember_copied) a <dst_path, source_dev, source_ino> triple. Relax the test that guards the hard-linked-dir check and the hard-link-preserving code. Remove the link-preserving semantics from cp_options.dereference. Clean up the code that preserves links for `cp -d' and `mv'. Introduce new options: --preserve[={mode,ownership,timestamps,links,all}] --no-preserve={mode,ownership,timestamps,links,all} -p and --preserve remain unchanged and are equivalent to `--preserve=mode,ownership,timestamps' * src/cp.c (enum) [NO_DEREFERENCE_OPTION]: New member. (enum) [NO_PRESERVE_ATTRIBUTES_OPTION]: New member. (enum) [PRESERVE_ATTRIBUTES_OPTION]: New member. (long_opts): Separate -d and --no-dereference options. Add `no-preserve'. Separate -p and --preserve options. The long-named --preserve now accepts optional arguments; -p doesn't. (usage): Describe additions and changes. (cp_option_init): Initialize new member, preserve_links, to 0. (decode_preserve_arg): New function. (main) [case 'a']: Set preserve_links to 1. [case 'd']: Set preserve_links to 1. Add `case' for long-named --no-dereference. Handle long-named --no-preserve and --preserve. * src/copy.h (enum Dereference_symlink): Add comments. (struct cp_options) [preserve_links]: New member. * src/install.c (cp_option_init): Initialize new member to 0. * src/mv.c (cp_option_init): Initialize new member to 1. * tests/cp/link-preserve: Add tests for some of the above.2001-10-13 Jim Meyering <meyering@lucent.com> * src/copy.h (struct cp_options) [failed_unlink_is_fatal]: Remove unused member. * src/mv.c (cp_option_init): Don't set it. * src/cp.c (cp_option_init): Likewise. * src/install.c (cp_option_init): Likewise. * src/copy.h (struct cp_options): Rename members: s/preserve_owner_and_group/preserve_ownership/, and s/preserve_chmod_bits/preserve_mode/. * src/copy.c, src/cp.c, src/install.c, src/mv.c: Update all uses. * man/chown.x: Fix typo: s/Sh/SH/ before OPTIONS. Reported by Eric S. Raymond.2001-10-12 Jim Meyering <meyering@lucent.com> * tests/ls/Makefile.am (TESTS): Add infloop. (XFAIL_TESTS): Mark it as a test that we expect to fail (temporarily). * tests/ls/infloop: New file.2001-10-11 Jim Meyering <meyering@lucent.com> * src/mknod.c (main): Tell what's wrong with `mknod c zero 1 5' rather than saying just `Try `./mknod --help' for more information.'. Suggestion from Karl Berry.2001-10-07 Jim Meyering <meyering@lucent.com> * TODO: Remove items relating to cp-hash.c, now that they're done. Allow cp -d (and mv when it resorts to copying) to preserve hard links that span command line arguments. * src/cp.c (do_copy): Don't clear the hash table after processing each command line argument. * tests/cp/link-preserve: New test for the above. * tests/cp/Makefile.am (TESTS): Add link-preserve. * src/cp-hash.c (remember_copied): Make a local copy of the file name. (src_to_dest_free): New function (to free the above).
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -