/* Implementation of pattern-matching file search paths for GNU Make.
-Copyright (C) 1988-2020 Free Software Foundation, Inc.
+Copyright (C) 1988-2022 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
-this program. If not, see <http://www.gnu.org/licenses/>. */
+this program. If not, see <https://www.gnu.org/licenses/>. */
#include "makeint.h"
#include "filedef.h"
also define HAVE_DOS_PATHS would like us to recognize
colons after the drive letter in the likes of
"D:/foo/bar:C:/xyzzy". */
- && (*p != PATH_SEPARATOR_CHAR
- || (p == v + 1 && (p[1] == '/' || p[1] == '\\')))
+ && (*p != PATH_SEPARATOR_CHAR || (p == v + 1 && ISDIRSEP (p[1])))
#else
&& *p != PATH_SEPARATOR_CHAR
#endif
entry, to where the nil-pointer terminator goes.
Usually this is maxelem - 1. If not, shrink down. */
if (elem < (maxelem - 1))
- vpath = xrealloc (vpath, (elem+1) * sizeof (const char *));
+ vpath = xrealloc ((void *)vpath, (elem+1) * sizeof (const char *));
/* Put the nil-pointer terminator on the end of the VPATH list. */
vpath[elem] = NULL;
size_t vlen = strlen (vpath[i]);
/* Put the next VPATH entry into NAME at P and increment P past it. */
- memcpy (p, vpath[i], vlen);
- p += vlen;
+ p = mempcpy (p, vpath[i], vlen);
/* Add the directory prefix already in *FILE. */
if (name_dplen > 0)
if ((*p != ':') && (*p != ']') && (*p != '>'))
*p++ = '/';
#endif
- memcpy (p, file, name_dplen);
- p += name_dplen;
+ p = mempcpy (p, file, name_dplen);
}
#ifdef HAVE_DOS_PATHS