aboutsummaryrefslogtreecommitdiff
path: root/gcc/prefix.c
diff options
context:
space:
mode:
authorHerman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl>1999-10-26 07:54:13 +0200
committerJeff Law <law@gcc.gnu.org>1999-10-25 23:54:13 -0600
commit7146dfdd90fdefc463f64b6fa4f4955b07415b78 (patch)
tree206376b5e985a441b8b9f349221e20accedc1ea1 /gcc/prefix.c
parent1722c704a22f88024973a2aff0ce0f95ec227c72 (diff)
downloadgcc-7146dfdd90fdefc463f64b6fa4f4955b07415b78.zip
gcc-7146dfdd90fdefc463f64b6fa4f4955b07415b78.tar.gz
gcc-7146dfdd90fdefc463f64b6fa4f4955b07415b78.tar.bz2
* prefix.c (translate_name) Check for empty prefix string.
From-SVN: r30180
Diffstat (limited to 'gcc/prefix.c')
-rw-r--r--gcc/prefix.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/prefix.c b/gcc/prefix.c
index c659c28..e37f69b 100644
--- a/gcc/prefix.c
+++ b/gcc/prefix.c
@@ -279,8 +279,9 @@ translate_name (name)
if (prefix == 0)
prefix = PREFIX;
- /* Remove any trailing directory separator from what we got. */
- if (IS_DIR_SEPARATOR (prefix[strlen (prefix) - 1]))
+ /* Remove any trailing directory separator from what we got. First check
+ for an empty prefix. */
+ if (prefix[0] && IS_DIR_SEPARATOR (prefix[strlen (prefix) - 1]))
{
char * temp = xstrdup (prefix);
temp[strlen (temp) - 1] = 0;