summaryrefslogtreecommitdiff
path: root/src/ln.c
AgeCommit message (Collapse)Author
2006-11-18"ln --backup f f" produces a misleading diagnostic:Jim Meyering
ln: creating hard link `f' => `f': No such file or directory * src/ln.c (do_link): Give a better diagnostic in this unusual case. (do_link): Rename local: s/lstat_ok/dest_lstat_ok/. * tests/ln/Makefile.am (TESTS): Add hard-backup. * tests/ln/hard-backup: New test for the above.
2006-09-19* src/ln.c (target_directory_operand): Rewrite to avoid portingPaul Eggert
problem on Tandem reported by Matthew Woehlke in <https://savannah.gnu.org/bugs/?17172>.
2006-09-03Don't include dirname.h, since system.h does it now.Paul Eggert
2006-08-28* src/copy.c (copy_internal): Don't test whether macros likePaul Eggert
S_ISLNK are defined, since they're always defined now. * src/cp.c (main): Likewise. * src/ln.c (main): Likewise. * src/ls.c (get_link_name, make_link_name): Likewise. * src/mkfifo.c (usage): Likewise. * src/who.c (S_IWGRP): Likewise.
2006-07-01* src/ln.c (do_link): Use new, shorter URL, for ag-review link.Jim Meyering
2006-04-12(linkfunc): Remove. This method ran into a compiler/linkerPaul Eggert
bug in Interix. Just call symlink or link directly. All uses changed.
2006-03-26(target_directory_operand, main): Use new last_component, in place of base_name.Jim Meyering
2005-11-16(do_link, usage): Improve quality of ln's diagnostics.Paul Eggert
(do_link): Don't use alloca on a buffer of unbounded size.
2005-11-05Include filenamecat.c.Jim Meyering
(FILE_BASENAME_CONCAT): Remove. (do_link): Remove last arg DEST_IS_DIR. All callers changed. (main): Use file_name_concat, base_name, and strip_trailing_slashes instead of FILE_BASENAME_CONCAT. This simplifies the code, and avoids the use of alloca.
2005-10-28(FILE_BASENAME_CONCAT): Omit unnecessary slashes in thePaul Eggert
boundary between DEST and SOURCE in the result.
2005-08-22(do_link): If ln is invoked with --interactive (-i),Jim Meyering
encounters an existing destination file, and gets an affirmative response, then first try to unlink the destination file rather than simply failing. Suggestion from Karl Berry.
2005-08-21(main): Declare `target_directory' with const attribute.Jim Meyering
2005-06-16Finally remove support for --version-control=S (-V).Jim Meyering
It was deprecated nearly 6 years ago and has been warning users to switch to --backup=S since fileutils-4.0j.
2005-06-02(FILE_BASENAME_CONCAT): Renamed from PATH_BASENAME_CONCAT.Paul Eggert
All uses changed.
2005-05-14Update FSF postal mail address.Jim Meyering
2005-05-14Update FSF postal mail address.Jim Meyering
2004-11-26(link, symlink): Remove decls.Paul Eggert
2004-09-21Remove unused "case 0".Paul Eggert
2004-09-13Adjust to backup enum rename.Paul Eggert
2004-08-03(symbolic_link, interactive, remove_existing_files,Paul Eggert
verbose, hard_dir_link, dereference_dest_dir_symlinks, do_link, main): Use bool for booleans.
2004-07-27(do_link): find_backup_file_name no longer returns NULL, so don'tPaul Eggert
bother to check for this.
2004-07-02Add short names -t and -T for --target-directoryJim Meyering
and --no-target-directory options, respectively. (NO_TARGET_DIRECTORY_OPTION, TARGET_DIRECTORY_OPTION): Remove. All uses changed to 'T' and 't', respectively. (long_options, main, usage): Add -t and -T as aliases for --target-directory and --no-target-directory, respectively.
2004-06-30Add support for --no-target-directory option.Jim Meyering
(NO_TARGET_DIRECTORY_OPTION): New constant. (long_options, usage, main): Add support for
2004-06-28 Use more-consistent rules among cp, ln, and mv when dealing withJim Meyering
last operands that are (or look like) directories. * src/cp.c (target_directory_operand): New, nearly-common function, It reports an error if the destination appears to be a directory (e.g., because it has a trailing slash) but is not. * src/ln.c, src/mv.c: Likewise. * src/cp.c (do_copy): Use it. * src/ln.c (main): Likewise. * src/mv.c (main): Likewise. * src/cp.c (do_copy): Don't output a usage message because of file problems (e.g., an operand is not a directory). Use it only for syntax. Standardize on "target %s is not a directory" for the diagnostic. * src/ln.c (main): Likewise. * src/mv.c (main): Likewise. * src/cp.c (do_copy): Remove test for trailing slash, since target_directory_operand now does this. * src/ln.c (main): Likewise. * src/mv.c (movefile): Likewise. * src/cp.c (main): Reject multiple target directories. Check whether a specified target is a directory when parsing the options, using stat. This gives more-accurate diagnostics. * src/ln.c (main): Likewise. * src/ln.c (isdir): Remove decl; no longer needed. * src/mv.c (isdir, lstat): Likewise. * src/ln.c (do_link): New arg dest_is_dir. All uses changed. Don't check the destination ourself; rely on dest_is_dir. This way we can avoid lstatting the destination in the usual case, and in the worst case we lstat 1, not 3 times. Don't bother to unlink unless link failed; this saves a syscall. Remove unnecessary backup_succeeded flag; it was identical to "dest_backup != NULL". * src/ln.c (main): Use int to count to argc, not unsigned int. This handles negative operand counts. * src/mv.c (main): Likewise.
2004-06-27Fix a bug: formerly, if d/x was a directory and x a file, "ln xJim Meyering
d/" incorrectly created a link d/x/x. It also saves some system calls. (main): Don't append basename to dest if this results in an existing directory name.
2004-06-25(do_link): Remove unnecessary call to lstat.Jim Meyering
(main): Avoid subscript error when the destination is "".
2004-06-21(main): Standardize on the diagnostics given when someone givesJim Meyering
too few operands ("missing operand after `xxx'") or too many operands ("extra operand `xxx'"). Include "quote.h" and/or "error.h" if it wasn't already being included.
2004-06-20Remove declaration of yesno.Jim Meyering
Instead, include yesno.h.
2004-04-27(backup_type): Declare `static'.Jim Meyering
2004-01-21(usage): Use EXIT_SUCCESS, not 0, for clarity.Jim Meyering
(usage): Don't bother normalizing exit status since the arg is already the correct exit status now.
2003-10-18Most .c files (AUTHORS): Revert the WRITTEN_BY/AUTHORS changeJim Meyering
of 2003-09-19. Now, AUTHORS is a comma-separated list of strings. Update the call to parse_long_options so that `AUTHORS, NULL' are the last parameters. * src/true.c (main): Append NULL to version_etc argument list. * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
2003-10-15(usage): Clarify that --directory, -d, -F probably won'tJim Meyering
work even for superuser. Suggestion from Dan Jacobson.
2003-09-28Remove unnecessary casts of alloca, since now it's guaranteed to be (void *).Jim Meyering
2003-09-28Minor efficiency tweak.Jim Meyering
(PATH_BASENAME_CONCAT): Use memcpy rather than strcpy. (do_link): Likewise.
2003-09-18(WRITTEN_BY): Rename from AUTHORS.Jim Meyering
Begin each WRITTEN_BY string with `Written by ' and end it with `.'. Mark each WRITTEN_BY string as translatable.
2003-09-18revert previous changeJim Meyering
2003-09-18Update AUTHORS definition to be a comma-separated list of strings and/or updateJim Meyering
the call to parse_long_options so that `AUTHORS, NULL' are the last parameters.
2003-08-30(do_link): Use SAME_INODE rather than open-coding it.Jim Meyering
2003-07-12It appears that the `#pragma alloca' included via "system.h" isJim Meyering
adequate, since join.c uses alloca, yet lacked an in-file #pragma. Remove `#pragma alloca'.
2003-06-19(ENABLE_HARD_LINK_TO_SYMLINK_WARNING): Define to 0.Jim Meyering
(do_link): Don't warn about hard link to symlink.
2003-06-17(main): Call initialize_main.Jim Meyering
2003-05-10(main): Test for `missing argument' before computing n_files.Jim Meyering
2003-04-11Remove SPC in SPC-TAB sequence.Jim Meyering
2002-10-08(main): Fix target_directory parsing when n_files == 1.Jim Meyering
Patch by Dmitry V. Levin.
2002-08-31Change `exit (0)' to `exit (EXIT_SUCCESS)',Jim Meyering
`exit (1)' to `exit (EXIT_FAILURE)', and `usage (1)' to `usage (EXIT_FAILURE)'.
2002-08-30Change `error (1, ...' to `error (EXIT_FAILURE, ...'.Jim Meyering
2002-07-02(usage): Use the PACKAGE_BUGREPORT e-mail address, rather than hard-coding it.Jim Meyering
2002-03-10(main): Change wording in diagnostic.Jim Meyering
2001-12-02Use new macros, HELP_OPTION_DESCRIPTION and VERSION_OPTION_DESCRIPTIONJim Meyering
instead of hard-coding --help and --version descriptions.
2001-11-23(usage): Note that ``Mandatory arguments to long options are mandatoryJim Meyering
for short options too.''