/* Compare two strings 'ls' x 'rs', returning an integer less-equal- -greater than zero if 'ls' is less-equal-greater than 'rs'. The code is a little tricky because it allows '\0' in the strings and it uses 'strcoll' (to respect locales) for each segments of the strings.  */
static int l_strcmp(const TString *ls, const TString *rs)
/* Compare two strings 'ls' x 'rs', returning an integer less-equal- -greater than zero if 'ls' is less-equal-greater than 'rs'. The code is a little tricky because it allows '\0' in the strings and it uses 'strcoll' (to respect locales) for each segments of the strings.  */
static int l_strcmp(const TString *ls, const TString *rs)
{
    int temp = strcoll(l, r);
    if (temp != 0)
      return temp;
    else {
      size_t len = strlen(l);
      if (len == lr)
        return (len == ll) ? 0 : 1;
      else if (len == ll)
        return -1;
      len++;
      l += len; ll -= len; r += len; lr -= len;
    }
  }
}