]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Wed May 1 09:10:04 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> cvs/libc-960502
authorRoland McGrath <roland@gnu.org>
Thu, 2 May 1996 00:26:56 +0000 (00:26 +0000)
committerRoland McGrath <roland@gnu.org>
Thu, 2 May 1996 00:26:56 +0000 (00:26 +0000)
* sysdeps/mach/hurd/getcwd.c: Jump out of both loops when we find a
name, instead of checking for reaching end of buffer, which happens
when the match is the last entry in the buffer.

sysdeps/mach/hurd/getcwd.c

index 039f1341d5b53e86fba57749b3190d65b53cf50b..02699a7e84faa431942ae39d25d636c3516eca1a 100644 (file)
@@ -185,14 +185,9 @@ __getcwd (char *buf, size_t size)
                  if (err)
                    goto errlose;
                  if (st.st_dev == thisdev && st.st_ino == thisino)
-                   break;
+                   goto found;
                }
            }
-
-         if (offset < dirdatasize)
-           /* We got a match; avoid doing another dir_readdir, which will
-               hose NENTRIES.  */
-           break;
        }
 
       if (err)
@@ -206,6 +201,7 @@ __getcwd (char *buf, size_t size)
          goto errlose;
        }
       else
+      found:
        {
          /* Prepend the directory name just discovered.  */