ignore # and . files when searching for source files

This commit is contained in:
Paul Gardner-Stephen committed 2019-04-19 20:29:41 +09:30
1 parent eef931a567
commit 0605c85169
1 file changed
+1
+1
View File
@@ -91,6 +91,7 @@ int main(int argc,char **argv)
if (!d) DO_ERROR("opendir() failed"); if (!d) DO_ERROR("opendir() failed");
while((de=readdir(d))!=NULL) { while((de=readdir(d))!=NULL) {
if (strlen(de->d_name)>2) { if (strlen(de->d_name)>2) {
if (de->d_name[0]!='.'&&de->d_name[0]!='#') // ignore temp files etc
if (!strcmp(&de->d_name[strlen(de->d_name)-2],".s")) { if (!strcmp(&de->d_name[strlen(de->d_name)-2],".s")) {
if (strcmp(de->d_name,"combined.s")) { if (strcmp(de->d_name,"combined.s")) {
if (source_count>=MAX_FILES) DO_ERROR("Too many source files. Increase MAX_FILES?"); if (source_count>=MAX_FILES) DO_ERROR("Too many source files. Increase MAX_FILES?");