aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-01-09 15:10:30 +0000
committerRichard Stallman <rms@gnu.org>1993-01-09 15:10:30 +0000
commit4cf3301cf5c82d0a4ae0c36cec9cb1427d9d5dfc (patch)
tree210c491330fc9dc8232beed9c14ac9502e31d5e0
parent6de2de122b3b23a3aefad6385a41ad127a2922b9 (diff)
downloadgcc-4cf3301cf5c82d0a4ae0c36cec9cb1427d9d5dfc.zip
gcc-4cf3301cf5c82d0a4ae0c36cec9cb1427d9d5dfc.tar.gz
gcc-4cf3301cf5c82d0a4ae0c36cec9cb1427d9d5dfc.tar.bz2
(lookup_compiler): Fix special code for `-' suffix.
From-SVN: r3174
-rw-r--r--gcc/gcc.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 2f21fcb..ff13c10 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -3664,12 +3664,13 @@ lookup_compiler (name, length, language)
/* Look for a suffix. */
for (cp = compilers + n_compilers - 1; cp >= compilers; cp--)
{
- if (strlen (cp->suffix) < length
- /* See if the suffix matches the end of NAME. */
- && !strcmp (cp->suffix,
- name + length - strlen (cp->suffix))
- /* The suffix `-' matches only the file name `-'. */
- && !(!strcmp (cp->suffix, "-") && length != 1))
+ if (/* The suffix `-' matches only the file name `-'. */
+ (!strcmp (cp->suffix, "-") && !strcmp (name, "-"))
+ ||
+ (strlen (cp->suffix) < length
+ /* See if the suffix matches the end of NAME. */
+ && !strcmp (cp->suffix,
+ name + length - strlen (cp->suffix))))
{
if (cp->spec[0][0] == '@')
{