summaryrefslogtreecommitdiff
path: root/src/ln.c
AgeCommit message (Collapse)Author
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.''
2001-11-23Split usage strings so that --help and --versionJim Meyering
descriptions are alone in their own string.
2001-11-23(usage): Split --help output into smaller pieces.Jim Meyering
Use fputs, not printf.
2001-08-14(AUTHORS): Mark string for translation, since it contains the English word ↵Jim Meyering
`and'.
2001-07-02(do_link): Test the boolean symbolic_link, not the function, symlink.Jim Meyering
Patch by Frederik Eaton.
2001-05-12(strip_trailing_slashes): Remove declaration; now in dirname.h.Jim Meyering
2001-02-03(main): Change type of index variable to `unsigned int' to avoid a warning.Jim Meyering
2000-12-24(main): Actually use the local variable, `backup_suffix_string'.Jim Meyering
2000-09-04(do_link): Tweak diagnostics.Jim Meyering
2000-08-08(do_link): Invoke xalloc_die instead of printing our own message.Jim Meyering
2000-07-24Convert "`%s'" in format strings to "%s", and wrap eachJim Meyering
corresponding argument in a `quote (...)' call. Add more precise diagnostics.
2000-05-15(do_link): Use complete strings in diagnostics so theyJim Meyering
are easier to translate. Reported by Michel Robitaille. (main): Drop support for the case in which S_ISLNK wasn't defined. It was broken in any case.
2000-05-13Arrange to call close_stdout only upon exit.Jim Meyering
2000-04-08Document that while the --backup option takes anJim Meyering
optional argument, the -b option accepts none. (main): Use `backup type' in call to xget_version, not the now-deprecated `--version-control'.
2000-01-24(usage): Describe behavior when LINK_NAME is omitted.Jim Meyering
From Michael Stone.
2000-01-09(do_link): Produce the same sort of one-line output forJim Meyering
`--backup --verbose' as cp, mv, install. Before this, the backup file name wasn't printed at all.
1999-12-23(usage): Correct typos.Jim Meyering
List new --target-directory=... usage. Reported by Göran Uddeborg
1999-11-07(do_link): Warn that making a hard link to a symbolic link is not portable.Jim Meyering
1999-11-07Remove entire #if LINK_FOLLOWS_SYMLINKS block.Jim Meyering
1999-11-07Add comment prior to removing #if LINK_FOLLOWS_SYMLINKS blockJim Meyering