aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
authorDominique d'Humieres <dominiq@lps.ens.fr>2014-11-13 22:06:15 +0000
committerIlya Verbin <iverbin@gcc.gnu.org>2014-11-13 22:06:15 +0000
commitb08dec2fb20721e271504690dad8f32c7471fd01 (patch)
tree500d5852d5d9e50af0387d7edfae44eaec850108 /gcc/gcc.c
parent2933facbe06d589be4c3ab209216aaba611c4522 (diff)
downloadgcc-b08dec2fb20721e271504690dad8f32c7471fd01.zip
gcc-b08dec2fb20721e271504690dad8f32c7471fd01.tar.gz
gcc-b08dec2fb20721e271504690dad8f32c7471fd01.tar.bz2
re PR bootstrap/63853 (The use of strchrnul breaks bootstrap on x86_64-apple-darwin14.)
2014-11-13 Dominique Dhumieres <dominiq@lps.ens.fr> PR bootstrap/63853 gcc/ * gcc.c (handle_foffload_option): Replace strchrnul with strchr. * lto-wrapper.c (parse_env_var, append_offload_options): Likewise. From-SVN: r217524
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 4422fa0..653ca8d 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -3375,12 +3375,16 @@ handle_foffload_option (const char *arg)
if (arg[0] == '-')
return;
- end = strchrnul (arg, '=');
+ end = strchr (arg, '=');
+ if (end == NULL)
+ end = strchr (arg, '\0');
cur = arg;
while (cur < end)
{
- next = strchrnul (cur, ',');
+ next = strchr (cur, ',');
+ if (next == NULL)
+ next = strchr (cur, '\0');
next = (next > end) ? end : next;
target = XNEWVEC (char, next - cur + 1);
@@ -3400,7 +3404,9 @@ handle_foffload_option (const char *arg)
c = OFFLOAD_TARGETS;
while (c)
{
- n = strchrnul (c, ',');
+ n = strchr (c, ',');
+ if (n == NULL)
+ n = strchr (c, '\0');
if (strlen (target) == (size_t) (n - c)
&& strncmp (target, c, n - c) == 0)
@@ -3421,7 +3427,9 @@ handle_foffload_option (const char *arg)
c = offload_targets;
do
{
- n = strchrnul (c, ':');
+ n = strchr (c, ':');
+ if (n == NULL)
+ n = strchr (c, '\0');
if (strlen (target) == (size_t) (n - c)
&& strncmp (c, target, n - c) == 0)