version 1.11, 2002/09/23 04:10:14 |
version 1.12, 2003/04/10 23:21:57 |
|
|
% lndir ../X |
% lndir ../X |
*/ |
*/ |
|
|
#include <stdio.h> |
|
#include <stdlib.h> |
|
#include <sys/types.h> |
|
#include <sys/stat.h> |
|
#include <sys/param.h> |
#include <sys/param.h> |
|
#include <sys/stat.h> |
|
|
|
#include <dirent.h> |
#include <err.h> |
#include <err.h> |
#include <errno.h> |
#include <errno.h> |
#include <dirent.h> |
|
#include <stdarg.h> |
#include <stdarg.h> |
|
#include <stdio.h> |
|
#include <stdlib.h> |
#include <string.h> |
#include <string.h> |
#include <unistd.h> |
#include <unistd.h> |
|
|
|
|
{ |
{ |
char *s; |
char *s; |
|
|
if (!strcmp(lname, rname)) |
if (strcmp(lname, rname) == 0) |
return(1); |
return(1); |
for (s = lname; *s && (s = strchr(s, '/')); s++) { |
for (s = lname; *s && (s = strchr(s, '/')); s++) { |
while (s[1] == '/') |
while (s[1] == '/') |
|
|
|
|
new = (struct except *)malloc(sizeof(struct except)); |
new = (struct except *)malloc(sizeof(struct except)); |
if (new == (struct except *)NULL) |
if (new == (struct except *)NULL) |
err(1, "addexcept"); |
err(1, NULL); |
new->name = strdup(name); |
new->name = strdup(name); |
if (new->name == (char *)NULL) |
if (new->name == (char *)NULL) |
err(1, "addexcept"); |
err(1, NULL); |
|
|
new->next = exceptions; |
new->next = exceptions; |
exceptions = new; |
exceptions = new; |
|
|
DIR *df; |
DIR *df; |
|
|
if (fs->st_dev == ts->st_dev && fs->st_ino == ts->st_ino) { |
if (fs->st_dev == ts->st_dev && fs->st_ino == ts->st_ino) { |
warn("%s: From and to directories are identical!", fn); |
warnx("%s: From and to directories are identical!", fn); |
return(1); |
return(1); |
} |
} |
|
|
|
|
void |
void |
usage(void) |
usage(void) |
{ |
{ |
(void)fprintf(stderr, "usage: %s [-e except] [-si] fromdir todir\n", |
(void)fprintf(stderr, "usage: %s [-e except] [-si] fromdir [todir]\n", |
__progname); |
__progname); |
exit(1); |
exit(1); |
} |
} |