Ctags patched

There's bug in original version of ctags 5.8. Let's look at example.

We have two files: "one.c" "two.c"

one.c:

typedef struct {
int iOne;
int iTwo;
} T_MyStruct1;

two.c:

typedef struct {
long lLong1;
long lLong2;
long lLong3;
} T_MyStruct2;

I make tags:

ctags -f tags ./one.c ./two.c

Contents of tags file will be:

T_MyStruct1 ./one.c /^} T_MyStruct1;/;" t typeref:struct:__anon1 file:
T_MyStruct2 ./two.c /^} T_MyStruct2;/;" t typeref:struct:__anon2 file:
iOne ./one.c /^ int iOne;$/;" m struct:__anon1 file:
iTwo ./one.c /^ int iTwo;$/;" m struct:__anon1 file:
lLong1 ./two.c /^ long lLong1;$/;" m struct:__anon2 file:
lLong2 ./two.c /^ long lLong2;$/;" m struct:__anon2 file:
lLong3 ./two.c /^ long lLong3;$/;" m struct:__anon2 file:

All OK here. But if i index these files separately with "-a" (append) key:

ctags -f tags ./one.c
ctags -a -f tags ./two.c

Then contents of tags file will be:

T_MyStruct1 ./one.c /^} T_MyStruct1;/;" t typeref:struct:__anon1 file:
T_MyStruct2 ./two.c /^} T_MyStruct2;/;" t typeref:struct:__anon1 file:
iOne ./one.c /^ int iOne;$/;" m struct:__anon1 file:
iTwo ./one.c /^ int iTwo;$/;" m struct:__anon1 file:
lLong1 ./two.c /^ long lLong1;$/;" m struct:__anon1 file:
lLong2 ./two.c /^ long lLong2;$/;" m struct:__anon1 file:
lLong3 ./two.c /^ long lLong3;$/;" m struct:__anon1 file:

look: members of both T_MyStruct1 and T_MyStruct2 are merged into __anon1 struct. This is fail.

At first sight there's no problem: we just should index files by one command only, and all will be ok.
Well, this is correct until command length is less than OS maximum command length. For example, at Windows XP this is 8192 bytes, for modern Linux distributions - more than 2 millions.

I had faced this problem during making my Indexer plugin for Vim. This plugin generates tags for all files in project. So, if there's more than 200 files in project, then at Windows systems my plugin fails. And with a really large projects 2 millions is not enough too, unfortunately. So, i had to make patch for ctags.

Patched version of ctags using another anonymous structs naming method: "__anon_<filename>_<linenumber>".

You can download: 

Linux source (gzipped): ctags-5.8.1.tar.gz
Patch for version 5.8: patch_ctags_581.patch
Windows binary: ctags.zip