Contributed regexp engine patch from Tom Lane.  Backports clean from trunk.
Contributed patch from Tom Lane <tgl@users.sf.net>.  Merge conflicts due to
different coding style and lingering obsolete compiler support resolved.
New routine hasnonemptyout() for minor improvement to new fixempties().
New routine hasnonemptyout() for minor improvement to new fixempties().
Use flag argument to combine copy(nonempty)* routines into copy* routines.
Use flag argument to combine copy(nonempty)* routines into copy* routines.
Indent reduction in fixempties().
Indent reduction in fixempties()
Rework into Tcl 8.4 coding style (closer to original Spencer).
merge 8.4
3604074,3606683 Rewrite of the fixempties() routine (and supporting routines)
to completely eliminate the infinite loop hazard.  Thanks to Tom Lane for the
much improved solution.
Rework into Tcl 8.5+ coding style.
merge 8.5
3604074,3606683 Rewrite of the fixempties() routine (and supporting routines)
to completely eliminate the infinite loop hazard.  Thanks to Tom Lane for the
much improved solution.