summaryrefslogtreecommitdiff
path: root/gcc/prefix.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1999-10-26 05:54:13 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1999-10-26 05:54:13 +0000
commit3678b14e92ec93c1dcd36e34af07f19faaff0326 (patch)
tree206376b5e985a441b8b9f349221e20accedc1ea1 /gcc/prefix.c
parent34834d2adecd37414082f858b3b4d4f492588ef7 (diff)
downloadgcc-3678b14e92ec93c1dcd36e34af07f19faaff0326.tar.gz
* prefix.c (translate_name) Check for empty prefix string.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30180 138bc75d-0d04-0410-961f-82ee72b054a4
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 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;