[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.7 and 1.8

version 1.7, 2002/02/16 21:27:47 version 1.8, 2002/03/28 02:36:03
Line 119 
Line 119 
   
     /* to directory */      /* to directory */
     if (stat(tn, &ts) < 0)      if (stat(tn, &ts) < 0)
         errx(1, "%s", tn);          err(1, "%s", tn);
     if (!(S_ISDIR(ts.st_mode)))      if (!(S_ISDIR(ts.st_mode)))
         errx(2, "%s: Not a directory", tn);          errx(2, "%s: %s", tn, strerror(ENOTDIR));
     if (chdir(tn) < 0)      if (chdir(tn) < 0)
         errx(1, "%s", tn);          err(1, "%s", tn);
   
     /* from directory */      /* from directory */
     if (stat(fn, &fs) < 0)      if (stat(fn, &fs) < 0)
         errx(1, "%s", fn);          err(1, "%s", fn);
     if (!(S_ISDIR(fs.st_mode)))      if (!(S_ISDIR(fs.st_mode)))
         errx(2, "%s: Not a directory", fn);          err(2, "%s: %s", fn, strerror(ENOTDIR));
   
     exit(dodir (fn, &fs, &ts, 0));      exit(dodir (fn, &fs, &ts, 0));
 }  }
Line 158 
Line 158 
   
     new = (struct except *)malloc(sizeof(struct except));      new = (struct except *)malloc(sizeof(struct except));
     if (new == (struct except *)NULL)      if (new == (struct except *)NULL)
         errx(1, "addexcept");          err(1, "addexcept");
     new->name = strdup(name);      new->name = strdup(name);
     if (new->name == (char *)NULL)      if (new->name == (char *)NULL)
         errx(1, "addexcept");          err(1, "addexcept");
   
     new->next = exceptions;      new->next = exceptions;
     exceptions = new;      exceptions = new;
Line 267 
Line 267 
                 }                  }
                 dodir(buf, &sb, &sc, (buf[0] != '/'));                  dodir(buf, &sb, &sc, (buf[0] != '/'));
                 if (chdir ("..") < 0)                  if (chdir ("..") < 0)
                     errx (1, "..");                      err (1, "..");
                 curdir = rcurdir = ocurdir;                  curdir = rcurdir = ocurdir;
                 continue;                  continue;
             }              }

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8