]> sourceware.org Git - glibc.git/commitdiff
Fix O_DIRECTORY lookup on trivial translators
authorFlavio Cruz <flaviocruz@gmail.com>
Tue, 12 Jan 2016 23:48:30 +0000 (00:48 +0100)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Tue, 12 Jan 2016 23:48:30 +0000 (00:48 +0100)
* hurd/lookup-retry.c (__hurd_file_name_lookup_retry): Do not remove
leading slash when `file_name' is "/".

ChangeLog
hurd/lookup-retry.c

index 6322a675a3448cffbe28bb6a47514bfb35603494..025db2bbcee828c30030d7f756d1866fca3dc032 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-01-13  Flavio Cruz  <flaviocruz@gmail.com>
+
+       * hurd/lookup-retry.c (__hurd_file_name_lookup_retry): Do not remove
+       leading slash when `file_name' is "/".
+
 2016-01-12  Joseph Myers  <joseph@codesourcery.com>
 
        * bits/mman-linux.h [!MCL_CURRENT] (MCL_ONFAULT): New macro.
index ef256acfb7db37a6df90934b9773672f732f1511..aee2ba8f93ffd967c495df62848d6a1c83fb245f 100644 (file)
@@ -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));
This page took 0.174485 seconds and 5 git commands to generate.