[BACK]Return to lndir.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / lndir

Diff for /src/usr.bin/lndir/lndir.c between version 1.11 and 1.12

version 1.11, 2002/09/23 04:10:14 version 1.12, 2003/04/10 23:21:57
Line 47 
Line 47 
         %  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>
   
Line 136 
Line 136 
 {  {
         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] == '/')
Line 152 
Line 152 
   
         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;
Line 184 
Line 184 
         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);
         }          }
   
Line 306 
Line 306 
 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);
 }  }

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12