* prefix.c (translate_name) Check for empty prefix string.

From-SVN: r30180
This commit is contained in:
Herman A.J. ten Brugge 1999-10-26 07:54:13 +02:00 committed by Jeff Law
parent 1722c704a2
commit 7146dfdd90
2 changed files with 7 additions and 2 deletions

View File

@ -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.

View File

@ -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;