From 03e47517ee125eb4fb3e42258ff4808bf0c2dd09 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Thu, 18 Oct 2012 15:14:20 +0000 Subject: [PATCH] Give it a better chance to work on MacOS X --- src/code.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/code.c b/src/code.c index b2a8cb0..a04fa75 100644 --- a/src/code.c +++ b/src/code.c @@ -166,7 +166,11 @@ static AsmFormat * _new_file_format(char const * filename, FILE * fp) DIR * dir; struct dirent * de; size_t len; +#ifdef __APPLE__ + char const ext[] = ".dylib"; +#else char const ext[] = ".so"; +#endif int hasflat = 0; AsmFormat * format = NULL; @@ -180,7 +184,7 @@ static AsmFormat * _new_file_format(char const * filename, FILE * fp) } while((de = readdir(dir)) != NULL) { - if((len = strlen(de->d_name)) < 4) + if((len = strlen(de->d_name)) < sizeof(ext)) continue; if(strcmp(&de->d_name[len - sizeof(ext) + 1], ext) != 0) continue;