Hi,
You are right.
After checking about that, it was understood that there are two problems.
1. Treatment of NULL file
A NULL file (file size == 0) is treated as a correct db file.
This is the cause of the inappropriate message ('...seems older format').
It should be treated as a corrupted file (EFTYPE error).
2. Another inappropriate message
Currently, when a tag file is corrupted, you will see the following message.
global: GTAGS not found.
This isn't also appropriate. I think it should be like the following.
global: <full path>/GTAGS seems to be corrupted.
What do you think?
This is an example:
-------------------------------------------------------------------------------
Current GLOBAL (6.5.4)
-------------------------------------------------------------------------------
$ echo 'main(){}' >main.c
$ gtags
$ global -x main
main 1 main.c main(){}
$ cp /dev/null GTAGS
$ global -x main
global: /tmp/test/GTAGS seems older format. Please remake tag files.
$ echo aaa >GTAGS
$ global -x main
global: GTAGS not found.
-------------------------------------------------------------------------------
|
v
-------------------------------------------------------------------------------
New GLOBAL (6.5.5?)
-------------------------------------------------------------------------------
$ echo 'main(){}' >main.c
$ gtags
$ global -x main
main 1 main.c main(){}
$ cp /dev/null GTAGS
$ global -x main
global: /tmp/test/GTAGS seems to be corrupted.
$ echo aaa >GTAGS
$ global -x main
global: /tmp/test/GTAGS seems to be corrupted.
-------------------------------------------------------------------------------
Thank you for making me notice the basic bug.
Regards,
Shigio