diff --git a/src/preprocess.c b/src/preprocess.c index 48661557..c08d1aeb 100644 --- a/src/preprocess.c +++ b/src/preprocess.c @@ -91,14 +91,15 @@ int main(int argc,char **argv) if (!d) DO_ERROR("opendir() failed"); while((de=readdir(d))!=NULL) { if (strlen(de->d_name)>2) { - if (!strcmp(&de->d_name[strlen(de->d_name)-2],".s")) { - if (strcmp(de->d_name,"combined.s")) { - if (source_count>=MAX_FILES) DO_ERROR("Too many source files. Increase MAX_FILES?"); - source_files[source_count].file=strdup(de->d_name); - source_files[source_count].address=-1; - source_count++; + 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,"combined.s")) { + if (source_count>=MAX_FILES) DO_ERROR("Too many source files. Increase MAX_FILES?"); + source_files[source_count].file=strdup(de->d_name); + source_files[source_count].address=-1; + source_count++; + } } - } } } if (retVal) break;