summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
5b50d65)
Allow -f flag to override existing symlink tree.
char *rcurdir;
char *curdir;
char *rcurdir;
char *curdir;
void
quit (
#if NeedVarargsPrototypes
void
quit (
#if NeedVarargsPrototypes
- /* Link exists in new tree. Print message if it doesn't match. */
- if (!equivalent (basesymlen>=0 ? basesym : buf, symbuf))
- msg ("%s: %s", dp->d_name, symbuf);
- } else {
- if (symlink (basesymlen>=0 ? basesym : buf, dp->d_name) < 0)
+ if (!equivalent (basesymlen>=0 ? basesym : buf, symbuf)) {
+ if (force) {
+ unlink(dp->d_name);
+ if (symlink (basesymlen>=0 ? basesym : buf, dp->d_name) < 0)
+ } else {
+ /* Link exists in new tree. Print message if it doesn't match. */
+ msg ("%s: %s", dp->d_name, symbuf);
+ }
+ }
+ } else {
+ if (symlink (basesymlen>=0 ? basesym : buf, dp->d_name) < 0)
+ mperror (dp->d_name);
closedir (df);
return 0;
}
closedir (df);
return 0;
}
char *prog_name = av[0];
char *fn, *tn;
struct stat fs, ts;
char *prog_name = av[0];
char *fn, *tn;
struct stat fs, ts;
while (++av, --ac) {
if (strcmp(*av, "-silent") == 0)
while (++av, --ac) {
if (strcmp(*av, "-silent") == 0)