summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/prefix.c5
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 <Haj.Ten.Brugge@net.HCC.nl>
+
+ * prefix.c (translate_name) Check for empty prefix string.
+
Mon Oct 25 23:10:45 1999 Andreas Schwab <schwab@suse.de>
* 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;