This is great, Kurt. The source in src/runtime/hrs/src for rsort.c is their version of my external sort, modified to be a subroutine. There's some lessons to be learned about "software hygiene". I was cavalier about freeing what I allocated dynamically. As a result, their version leaks like a sieve if the subroutine is called repeatedly. Apropos of which, they came to me having noted that only the first call was acting as expected. There's a wonderful irony (I'm big on irony). I had replaced my do-it-yourself argument processing with getopt. The code has the following comment
** Use getopt() for portability.
A few lines later, you see
optind = 1; /* reset after use in Hancock program *
while ((c = getopt(argc, argv, "cCiIjmrsSuvb:f:D:o:p:T:x:y:z:")) != EOF) {
optind??? Seems getopt has an undocumented global flag to prevent reprocessing the arguments. How portable:-)