*** cproto-4.4/yyerror.c Wed Jan 20 23:27:17 1999 --- cproto-4.4/yyerror.c.s-max Sun Jan 10 13:46:57 1999 *************** *** 125,145 **** if (count < 0) { if (last++ >= 0) { ! qsort((char *)vec, (size_t)last, sizeof(vec[0]), compar); ! /* limit length of error message */ ! k = 80 - (strlen(vec[last-1]) + 2); ! for (j = 0; j < last; j++) { ! tag = j ? " " : "Expected: "; ! s = vec[j]; ! if (j != (last - 1)) { ! x = strlen(s) + strlen(tag); ! if (k <= 0) ! continue; ! else if ((k - x) <= 0) ! s = "..."; ! k -= x; } - fprintf(stderr, "%s%s", tag, s); } fprintf(stderr, "\n"); } --- 125,147 ---- if (count < 0) { if (last++ >= 0) { ! if (vec[last-1]) { ! qsort((char *)vec, (size_t)last, sizeof(vec[0]), compar); ! /* limit length of error message */ ! k = 80 - (strlen(vec[last-1]) + 2); ! for (j = 0; j < last; j++) { ! tag = j ? " " : "Expected: "; ! s = vec[j]; ! if (j != (last - 1)) { ! x = strlen(s) + strlen(tag); ! if (k <= 0) ! continue; ! else if ((k - x) <= 0) ! s = "..."; ! k -= x; ! } ! fprintf(stderr, "%s%s", tag, s); } } fprintf(stderr, "\n"); }