From: Richard Kenner Date: Tue, 10 Dec 1996 22:04:20 +0000 (-0500) Subject: (choose_temp_base): Don't dump core if TMPDIR is empty. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=df6ddd7337ab754fa671716ec400c05264b14e05;p=gcc.git (choose_temp_base): Don't dump core if TMPDIR is empty. From-SVN: r13263 --- diff --git a/gcc/choose-temp.c b/gcc/choose-temp.c index 2f35c4701db..798de4822a5 100644 --- a/gcc/choose-temp.c +++ b/gcc/choose-temp.c @@ -125,14 +125,13 @@ choose_temp_base () #endif len = strlen (base); - if (len == 0) - abort (); temp_filename = xmalloc (len + 1 /*DIR_SEPARATOR*/ + strlen (TEMP_FILE) + 1); strcpy (temp_filename, base); #ifndef MPW - if (temp_filename[len-1] != '/' + if (len != 0 + && temp_filename[len-1] != '/' && temp_filename[len-1] != DIR_SEPARATOR) temp_filename[len++] = DIR_SEPARATOR; #else /* MPW */