From 7146dfdd90fdefc463f64b6fa4f4955b07415b78 Mon Sep 17 00:00:00 2001 From: "Herman A.J. ten Brugge" Date: Tue, 26 Oct 1999 07:54:13 +0200 Subject: [PATCH] * prefix.c (translate_name) Check for empty prefix string. From-SVN: r30180 --- gcc/ChangeLog | 4 ++++ gcc/prefix.c | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 51ce968895e..c7251d8cdb6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +1999-10-25 Herman A.J. ten Brugge + + * prefix.c (translate_name) Check for empty prefix string. + Mon Oct 25 23:10:45 1999 Andreas Schwab * Makefile.in (CPP_CROSS_NAME): New variable. diff --git a/gcc/prefix.c b/gcc/prefix.c index c659c28e7be..e37f69be1ad 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;