-/* Copyright (C) 1992,93,94,95,96,97,99,2001 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#include <hurd.h>
#include <hurd/lookup.h>
dirname, 0, 0, dir);
}
}
+ else if (file_name[0] == '\0')
+ return ENOENT;
else
{
/* "foobar" => cwdir + "foobar". */
--lastslash;
/* Find the last one earlier in the string, before the trailing ones. */
-#if __GLIBC__ > 2 || __GLIBC_MINOR__ >= 2
lastslash = __memrchr (file_name, '/', lastslash - file_name);
-#else
- /* Keep backing up, looking for a slash. */
- do
- if (lastslash == file_name)
- {
- /* Hit the start with no slash. */
- lastslash = NULL;
- break;
- }
- while (*lastslash-- != '/');
-#endif
}
if (lastslash != NULL)
dirname, 0, 0, dir);
}
}
+ else if (file_name[0] == '\0')
+ return ENOENT;
else
{
/* "foobar" => cwdir + "foobar". */