[Ctags-devel] Lack of fnmatch(3) in Windows
Brought to you by:
dhiebert
|
From: Frank F. <ff...@us...> - 2013-08-24 20:25:47
|
Hi, As I am primarily a Windows user and developer I run into the next problems. A file named "Makefile" is being ignored by ctags. A --exclude option like "--exclude=sqlite3.*" is not recognized. Two separate exclude for the c and h file work as expected. These problems occur because there is no fnmatch() in the Windows C library. Therefore a string comparison is done in fileNameMatched() in strlist.c and patterns are not recognized. I see at least two possible ways to fix this problem. The first one is using the attached patmat.c. This a quite old code snippet that I have extended (long time ago as well) to support matching brackets. As far as I have found this routine is in PD, so it should be no problem to include in ctags. The second one is to port fnmatch() from NetBSD to Windows and include it in ctags. http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/gen/fnmatch.c http://cvsweb.netbsd.org/bsdweb.cgi/src/include/fnmatch.h I have tested the first option and made a quick and dirty adjustment to fileNameMatched(). This solves the problems. I haven't tried the second option. I think about adding a define USE_PATMAT to e_msoft.h and adjust fileNameMatched() accordingly. Maybe builds for other (non-Unix-like) platforms could benefit from this as well. What do you think? Regards, Frank |