Hi Maciej, > Date: 2026-11-07 02:44:23+0000 > From: "Maciej W. Rozycki" > > On Thu, 5 Nov 2026, Alejandro Colomar wrote: > > > Do you think strafterprefix() would be better? Do you have any other > > suggestions? > > FWIW strsuffix() seems an obvious choice to me. After all what the API > does is request the string's suffix beyond the specified leading part. Actually, strsuffix() is something else: char * strsuffix_(const char *str, const char *suffix) { ptrdiff_t off; off = strlen(str) - strlen(suffix); if (off < 0) return NULL; if (!streq(str + off, suffix)) return NULL; return str + off; } It finds the start of a suffix in a string. That is: strcmp(strsuffix("foobar", "bar"), "bar") == 0; Have a lovely day! Alex > > Maciej --