Commit 52999738 by Zack Weinberg

c-opts.c (add_prefixed_path): Don't use concat.

	* c-opts.c (add_prefixed_path): Don't use concat.  When
	prefixing with cpp_GCC_INCLUDE_DIR, copy only the first
	cpp_GCC_INCLUDE_DIR_len characters.

From-SVN: r64114
parent a489d8b0
...@@ -1701,10 +1701,20 @@ add_prefixed_path (suffix, chain) ...@@ -1701,10 +1701,20 @@ add_prefixed_path (suffix, chain)
const char *suffix; const char *suffix;
size_t chain; size_t chain;
{ {
char *path;
const char *prefix; const char *prefix;
size_t prefix_len, suffix_len;
prefix = iprefix ? iprefix: cpp_GCC_INCLUDE_DIR; suffix_len = strlen (suffix);
add_path (concat (prefix, suffix), chain, 0); prefix = iprefix ? iprefix : cpp_GCC_INCLUDE_DIR;
prefix_len = iprefix ? strlen (iprefix) : cpp_GCC_INCLUDE_DIR_len;
path = xmalloc (prefix_len + suffix_len + 1);
memcpy (path, prefix, prefix_len);
memcpy (path + prefix_len, suffix, suffix_len);
path[prefix_len + suffix_len] = '\0';
add_path (path, chain, 0);
} }
/* Set the C 89 standard (with 1994 amendments if C94, without GNU /* Set the C 89 standard (with 1994 amendments if C94, without GNU
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment