Eric Blake wrote: + if (suffix) + { + size_t len = strlen (template); + if (template[len - 1] != 'X')
If you pass '' the above is invalid + { + error (EXIT_FAILURE, 0, + _("with --suffix, template %s must end in X"), + quote (template)); + } + suffix_len = strlen (suffix); + dest_name = xcharalloc (len + suffix_len + 1); That's the first use of that function. Seems of marginal benefit. + memcpy (dest_name, template, len); + memcpy (dest_name + len, suffix, suffix_len + 1); + template = dest_name; + suffix = dest_name + len; + } Other than that it's a really nice patch. cheers, Pádraig.