THRIFT-2338 First doctext wrongly interpreted as program doctext in some cases

Patch: Jens Geyer