[BACK]Return to getcwd.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / lib / libc / gen

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/lib/libc/gen/getcwd.c between version 1.20 and 1.21

version 1.20, 1999/07/11 18:01:46 version 1.21, 1999/08/10 13:03:11
Line 86  realpath(path, resolved)
Line 86  realpath(path, resolved)
         char *resolved;          char *resolved;
 {  {
         struct stat sb;          struct stat sb;
         int fd, n, rootd, serrno;          int fd, n, rootd, serrno, nlnk = 0;
         char *p, *q, wbuf[MAXPATHLEN];          char *p, *q, wbuf[MAXPATHLEN];
   
         /* Save the starting point. */          /* Save the starting point. */
Line 126  loop:
Line 126  loop:
         /* Deal with the last component. */          /* Deal with the last component. */
         if (lstat(p, &sb) == 0) {          if (lstat(p, &sb) == 0) {
                 if (S_ISLNK(sb.st_mode)) {                  if (S_ISLNK(sb.st_mode)) {
                           if (nlnk++ >= MAXSYMLINKS) {
                                   errno = ELOOP;
                                   goto err1;
                           }
                         n = readlink(p, resolved, MAXPATHLEN);                          n = readlink(p, resolved, MAXPATHLEN);
                         if (n < 0)                          if (n < 0)
                                 goto err1;                                  goto err1;

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

CVSweb <webmaster@jp.NetBSD.org>