Thanks for the patches. There were no further comments in a week, therefore I pushed them in your name.
Still to be addressed: - Lack of documentation. - Code duplication. - Lack of unit tests. - Lack of configure option (suggested by Assaf Gordon in [1]). Bruno [1] https://lists.gnu.org/archive/html/bug-gnulib/2018-04/msg00088.html