diff options
author | Roland McGrath <roland@gnu.org> | 1996-05-02 00:26:56 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1996-05-02 00:26:56 +0000 |
commit | f5936b69da5912c7f66c8bb25a26df9f43afd1af (patch) | |
tree | 8503ac6d70b003f87715e9d62571036f46e16ee2 /sysdeps/mach/hurd/getcwd.c | |
parent | Wed May 1 09:10:04 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> (diff) | |
download | glibc-f5936b69da5912c7f66c8bb25a26df9f43afd1af.tar.gz glibc-f5936b69da5912c7f66c8bb25a26df9f43afd1af.tar.bz2 glibc-f5936b69da5912c7f66c8bb25a26df9f43afd1af.zip |
Wed May 1 09:10:04 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>cvs/libc-960502
* 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.
Diffstat (limited to 'sysdeps/mach/hurd/getcwd.c')
-rw-r--r-- | sysdeps/mach/hurd/getcwd.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/sysdeps/mach/hurd/getcwd.c b/sysdeps/mach/hurd/getcwd.c index 039f1341d5..02699a7e84 100644 --- a/sysdeps/mach/hurd/getcwd.c +++ b/sysdeps/mach/hurd/getcwd.c @@ -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. */ |