diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2016-10-09 19:34:06 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2016-10-09 19:34:06 +0200 |
commit | 6772d640a4f4874166a61f1859e1660a2913a89d (patch) | |
tree | 839fea4d5dcefab75577cecb563ccad4234eb953 /hurd/lookup-retry.c | |
parent | f98906bbb57cb495b4501afc5f18604ef3a94e2a (diff) | |
parent | 7bb5f8a836b916d6ebf7b6921b136e99cea2442d (diff) |
Merge commit 'refs/top-bases/t/hurdsig-fixes' into t/hurdsig-fixes
Diffstat (limited to 'hurd/lookup-retry.c')
-rw-r--r-- | hurd/lookup-retry.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/hurd/lookup-retry.c b/hurd/lookup-retry.c index 491a3a4c79..aee2ba8f93 100644 --- a/hurd/lookup-retry.c +++ b/hurd/lookup-retry.c @@ -1,5 +1,5 @@ /* hairy bits of Hurd file name lookup - Copyright (C) 1992-2015 Free Software Foundation, Inc. + Copyright (C) 1992-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -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)); |