Thanks for reporting that inaccurate diagnostic. Sorry about the tricky code; it's a tricky situation. Looks like Collin's patch is not quite right. I installed the attached patches into Gnulib. The first one fixes the two cases you mentioned, the second an unlikely bug I discovered in the neighborhood. Please give the patches a try. As they fix the bugs for me I am boldly closing the Coreutils bug report; we can reopen it if I'm wrong.