https://defect.opensolaris.org/bz/show_bug.cgi?id=16334



--- Comment #9 from seadog <[email protected]> 2010-07-03 23:27:03 UTC 
---
(In reply to comment #8)
> I tried ctags from cygwin and it worked somewhat better, in the sense that it
> didn't skip all the characters after 0x1a. But it still hung because it for
> some reason didn't print a newline character after the filter terminator.

Modify catFile in sort.c of CTags. Change the fopen call to be "rb" instead of
just "r". Binary mode works for Windows (it is ignored on POSIX platforms).
This way cygwin won't be required.

CTags will no longer skip the rest of the file. It will still output the weird
characters to the console but at least it doesn't stop mid file.

readTags in CTags.java needs to be modified also. It looks like the Java IO
stream treats the weird characters as whitespaces. At least that what I've seen
during debugging. Whenever defs.addTaf is called, all the string parameters
should have trim() called on them especially the match variable. It will
randomly have one trailing or one leading whitespace character. It will have
more whitespace characters when it encounters the bad characters scenario.

The proper fix for catFile in CTags should filter out and only print printable
characters but just changing the fopen call is sufficient as a minimum change.
With the proper fix in catFile, the match variable inside readTags in OpenGrok
sill has misc trailing/leading white space characters so a trim call is still
needed. trim() should probably be called on all the string variables (this
requires renaming 'string' on line 220 to something else like 'name'). 

I've made all the changes to CTags and OpenGrok described here plus the extra
check I mentioned in the forum thread. With all these changes I am able to
index without problems. I will submit a patch when I can.

I also noticed the ctags process never exits once it is done. It only behaves
like this when filter is set to yes as it is used in OpenGrok. OpenGrok will
also keep an orphaned reference to the CTags process.

-- 
Configure bugmail: https://defect.opensolaris.org/bz/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
opengrok-dev mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opengrok-dev

Reply via email to