summaryrefslogtreecommitdiff
path: root/src/pwd.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2004-11-23 09:44:17 +0000
committerJim Meyering <jim@meyering.net>2004-11-23 09:44:17 +0000
commitb90f1a4404ce7105acd424288af23bcc3f344c62 (patch)
tree8f3ce2d8216d342d1021cd47c64f266e30124b3a /src/pwd.c
parent5035b7181dd6e8db5e2f1a6d02acbf6afc0217ad (diff)
downloadcoreutils-b90f1a4404ce7105acd424288af23bcc3f344c62.tar.xz
tweak comment
Diffstat (limited to 'src/pwd.c')
-rw-r--r--src/pwd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pwd.c b/src/pwd.c
index 96b301396..787f46582 100644
--- a/src/pwd.c
+++ b/src/pwd.c
@@ -247,7 +247,7 @@ find_dir_entry (struct stat *dot_sb, struct Path *path, size_t parent_height)
/* Construct the full, absolute name of the current working
directory and store it in *PATH.
- The getcwd function does nearly the same task, but is typically
+ The getcwd function performs nearly the same task, but is typically
unable to handle names longer than PATH_MAX. This function has
no such limitation. However, this function *can* fail due to
permission problems or a lack of memory, while Linux's getcwd
@@ -260,6 +260,9 @@ find_dir_entry (struct stat *dot_sb, struct Path *path, size_t parent_height)
used as a getcwd replacement. Unfortunately, considering all of
the information the caller would require in order to produce good
diagnostics, it doesn't seem worth the added complexity.
+ In any case, any getcwd replacement must *not* exceed the PATH_MAX
+ limitation. Otherwise, functions like `chdir' would fail with
+ ENAMETOOLONG.
FIXME-maybe: if find_dir_entry fails due to permissions, try getcwd,
in case the unreadable directory is close enough to the root that