Follow-up Comment #1, bug #68585 (group groff): [comment #0 original submission:]
> Here's a sketch of my current plan of attack:
>
> * Kill off straggling uses of malloc()/calloc()/realloc()/free() in
> _src/libs/libgroff/string.cpp_.
> * string::contents() should return a `const char *`.
> * string::extract() should return a `char *`.
> * Neither function should worry about internal nulls; they should return a
> `char` sequence up to the first null byte. The return type will imply as
> much to any experienced C/C++ programmer anyway.
> * Users of the `string` class that employ _either_ `contents()` or
> `extract()` can be flagged as potential migrants to the C++ standard `string`
> class.
>
> Here's a diff of how far I pulled the yarn before giving up on trying to
> solve this problem for _groff_ 1.25.
One will observe that diff changed the return type of `string::extract()`
_away_ from the "reform" contemplated above. That's because I worked
backwards from how _tbl_ was using it.
A more successful reform, I suspect, will involve an audit of
`string::extract()`'s callers and migrate them to `string::contents()` where
possible. (In some places, the duplicated string _is_ mutated.)
Either change is too much disruption for the _groff_ 1.25 development cycle at
this point.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?68585>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
