Commit 4cf3301c by Richard Stallman

(lookup_compiler): Fix special code for `-' suffix.

From-SVN: r3174
parent 6de2de12
...@@ -3664,12 +3664,13 @@ lookup_compiler (name, length, language) ...@@ -3664,12 +3664,13 @@ lookup_compiler (name, length, language)
/* Look for a suffix. */ /* Look for a suffix. */
for (cp = compilers + n_compilers - 1; cp >= compilers; cp--) for (cp = compilers + n_compilers - 1; cp >= compilers; cp--)
{ {
if (strlen (cp->suffix) < length 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. */ /* See if the suffix matches the end of NAME. */
&& !strcmp (cp->suffix, && !strcmp (cp->suffix,
name + length - strlen (cp->suffix)) name + length - strlen (cp->suffix))))
/* The suffix `-' matches only the file name `-'. */
&& !(!strcmp (cp->suffix, "-") && length != 1))
{ {
if (cp->spec[0][0] == '@') if (cp->spec[0][0] == '@')
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment