summaryrefslogtreecommitdiff
path: root/hurd/path-lookup.c
diff options
context:
space:
mode:
Diffstat (limited to 'hurd/path-lookup.c')
-rw-r--r--hurd/path-lookup.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/hurd/path-lookup.c b/hurd/path-lookup.c
index 3186e8bf3d..5607d5809c 100644
--- a/hurd/path-lookup.c
+++ b/hurd/path-lookup.c
@@ -1,5 +1,5 @@
/* Filename lookup using a search path
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>
@@ -33,7 +33,7 @@ file_name_path_scan (const char *file_name, const char *path,
error_t (*fun)(const char *name),
char **prefixed_name)
{
- if (path == NULL || index (file_name, '/'))
+ if (path == NULL || strchr (file_name, '/'))
{
if (prefixed_name)
*prefixed_name = 0;
@@ -47,7 +47,7 @@ file_name_path_scan (const char *file_name, const char *path,
for (;;)
{
error_t err;
- const char *next = index (path, ':') ?: path + strlen (path);
+ const char *next = strchr (path, ':') ?: path + strlen (path);
size_t pfx_len = next - path;
char pfxed_name[pfx_len + 2 + file_name_len + 1];
@@ -63,7 +63,7 @@ file_name_path_scan (const char *file_name, const char *path,
if (err == 0)
{
if (prefixed_name)
- *prefixed_name = strdup (pfxed_name);
+ *prefixed_name = __strdup (pfxed_name);
return 0;
}
if (!real_err && err != ENOENT)
@@ -87,16 +87,16 @@ file_name_path_scan (const char *file_name, const char *path,
if it is looked up using a prefix from PATH, *PREFIXED_NAME is set to
malloced storage containing the prefixed name. */
error_t
-hurd_file_name_path_lookup (error_t (*use_init_port)
- (int which, error_t (*operate) (mach_port_t)),
- file_t (*get_dtable_port) (int fd),
- error_t (*lookup)
- (file_t dir, char *name, int flags, mode_t mode,
- retry_type *do_retry, string_t retry_name,
- mach_port_t *result),
- const char *file_name, const char *path,
- int flags, mode_t mode,
- file_t *result, char **prefixed_name)
+__hurd_file_name_path_lookup (error_t (*use_init_port)
+ (int which, error_t (*operate) (mach_port_t)),
+ file_t (*get_dtable_port) (int fd),
+ error_t (*lookup)
+ (file_t dir, const char *name, int flags, mode_t mode,
+ retry_type *do_retry, string_t retry_name,
+ mach_port_t *result),
+ const char *file_name, const char *path,
+ int flags, mode_t mode,
+ file_t *result, char **prefixed_name)
{
error_t scan_lookup (const char *name)
{
@@ -106,6 +106,7 @@ hurd_file_name_path_lookup (error_t (*use_init_port)
}
return file_name_path_scan (file_name, path, scan_lookup, prefixed_name);
}
+strong_alias (__hurd_file_name_path_lookup, hurd_file_name_path_lookup)
file_t
file_name_path_lookup (const char *file_name, const char *path,
@@ -114,9 +115,9 @@ file_name_path_lookup (const char *file_name, const char *path,
error_t err;
file_t result;
- err = hurd_file_name_path_lookup (&_hurd_ports_use, &__getdport, 0,
- file_name, path, flags, mode,
- &result, prefixed_name);
+ err = __hurd_file_name_path_lookup (&_hurd_ports_use, &__getdport, 0,
+ file_name, path, flags, mode,
+ &result, prefixed_name);
return err ? (__hurd_fail (err), MACH_PORT_NULL) : result;
}