diff --git a/src/display.c b/src/display.c index 49ddbd6..eb75830 100644 --- a/src/display.c +++ b/src/display.c @@ -308,9 +308,15 @@ void set_file_style( const directory_entry_t* const entry ) bool compare_makefile( const directory_entry_t* const entry ) { - return 0 == compare_strings( entry->name, "makefile", NAME_MAX, false ) - || 0 == compare_strings( entry->name, "readme", 6, false ) - || 0 == compare_strings( entry->name, "readme", 6, false ) + return 0 == compare_strings( entry->name, "makefile", 9, false ) + || 0 == compare_strings( entry->name, "readme", 7, false ) + /* do not compare the zero character, in order to also chatch + * readmes with extensions like '.md' or '.txt'. + * + * this also flags nonsensical files like 'readme.bullshit' + * but this is deemed acceptable + */ + || 0 == compare_strings( entry->name, "readme.", 7, false ) || 0 == compare_strings( entry->extension, "mk", 3, false ) || 0 == compare_strings( entry->name, "cmakelists.txt", 15, false ); }