]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - hurd/path-lookup.c
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / hurd / path-lookup.c
index 19434b61a46b7c16583cc27b44349b53b2422f68..3861d21cf7e8437fc05de78611068b1d4522e2c2 100644 (file)
@@ -1,5 +1,5 @@
 /* Filename lookup using a search path
-   Copyright (C) 1995, 1996, 1997 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>
 
@@ -14,9 +14,8 @@
    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 <string.h>
 #include <hurd.h>
@@ -34,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;
@@ -48,17 +47,17 @@ 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];
 
          if (pfx_len == 0)
            pfxed_name[pfx_len++] = '.';
          else
-           bcopy (path, pfxed_name, pfx_len);
+           memcpy (pfxed_name, path, pfx_len);
          if (pfxed_name[pfx_len - 1] != '/')
            pfxed_name[pfx_len++] = '/';
-         bcopy (file_name, pfxed_name + pfx_len, file_name_len + 1);
+         memcpy (pfxed_name + pfx_len, file_name, file_name_len + 1);
 
          err = (*fun)(pfxed_name);
          if (err == 0)