I found a bug regarding inline comments. When adding an inline comment # after 
an = assignment statement, if there is some space before the #, 
compilation fails.


If a makefile contains the following statements:
TARGET = output
This line works fine.


TARGET = output    # test
This line reports an error.


Suggested fix:
read.c remove_comments():


static void
remove_comments (char *line)
{
    if (line)
    {
        char *comment = find_map_unquote (line, 
MAP_COMMENT|MAP_VARIABLE);
        if (comment) 
        {
            //char b = 0;
            *comment = '\0';  /* Cut off the 
line at the #.  */


            while (comment != line)
            {
                if (--comment == line)
                    break;


                if (*comment == ' ' || 
*comment == '\t')  // Remove ' ' and '\t' before comment.
                {
//                    
 if (!b)
//                     {
//                      
   printf("remove_comments() |%s|\n", line);
//                      
   b = 1;
//                     }


                    *comment 
= '\0';
                }
                else
                    break;
            }
        }
    }
}


Thanks,
form DeDf

Reply via email to