From: Herman A.J. ten Brugge Date: Tue, 26 Oct 1999 05:54:13 +0000 (+0200) Subject: * prefix.c (translate_name) Check for empty prefix string. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7146dfdd90fdefc463f64b6fa4f4955b07415b78;p=platform%2Fupstream%2Fgcc.git * prefix.c (translate_name) Check for empty prefix string. From-SVN: r30180 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 51ce968..c7251d8 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 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;