Hi, Johannes.
First on the concept side, after thinking overnight about your proposal, I'm less convinced it's not to my taste and more convinced that it's just not what I'm used to in ratpoison. Indeed, I think if I were designing rp from scratch, I might do precisely what you propose. Perhaps some others will chime in with thoughts.
In the end, I rarely have same-named windows, so I'm not too invested either way. ;-)
From a user interface standpoint, I agree with you that a variable probably makes more sense if we want to preserve both behaviors. Let's see if anyone else has an opinion on preserving the old behavior. (We might only find out by deprecation, of course. ;-)
I see that there are 62 instances of strcmp() and only 9 instances of strncmp(). :(
Nonetheless (again, others please opine) I'd vote for a strncmp() with a new constant in, say, conf.h, rather than saying strcmp(-, -, 40).
Anyway, setting the length at the top and then using strncmp() lets the rest of the function run without needing two blocks, no? Although, as Bernhard notes, it's unclear why one is case-sensitive and the other not.
int max_match_length;
if(exact_match)
{
max_match_length = MAX_WINDOW_NAME_LENGTH;
}
else
{
max_match_length = strnlen(name, MAX_WINDOW_NAME_LENGTH);
}