diff options
author | Flavio Cruz <flaviocruz@gmail.com> | 2016-01-13 00:48:30 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2016-01-13 00:48:30 +0100 |
commit | e42ce0f45ebf20b4c6f89da605cd62b1cd60a9df (patch) | |
tree | c390f6019ad305f2ae5d1f9235342f87029e097e /hurd | |
parent | fb53a27c57417104069f128963bf6f26dc02b0bd (diff) | |
download | glibc-e42ce0f45ebf20b4c6f89da605cd62b1cd60a9df.zip glibc-e42ce0f45ebf20b4c6f89da605cd62b1cd60a9df.tar.gz glibc-e42ce0f45ebf20b4c6f89da605cd62b1cd60a9df.tar.bz2 |
Fix O_DIRECTORY lookup on trivial translators
* hurd/lookup-retry.c (__hurd_file_name_lookup_retry): Do not remove
leading slash when `file_name' is "/".
Diffstat (limited to 'hurd')
-rw-r--r-- | hurd/lookup-retry.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/hurd/lookup-retry.c b/hurd/lookup-retry.c index ef256ac..aee2ba8 100644 --- a/hurd/lookup-retry.c +++ b/hurd/lookup-retry.c @@ -62,8 +62,15 @@ __hurd_file_name_lookup_retry (error_t (*use_init_port) error_t lookup_op (file_t startdir) { - while (file_name[0] == '/') - file_name++; + if (file_name[0] == '/' && file_name[1] != '\0') + { + while (file_name[1] == '/') + /* Remove double leading slash. */ + file_name++; + if (file_name[1] != '\0') + /* Remove leading slash when we have more than the slash. */ + file_name++; + } return lookup_error ((*lookup) (startdir, file_name, flags, mode, &doretry, retryname, result)); |