| 2975 | |
| 2976 | char *answer = find_last_answer_marker(visible); |
| 2977 | if (answer) { |
| 2978 | const char *end = answer + strlen(answer); |
| 2979 | if (strlen(answer) > 96) end = answer + 96; |
| 2980 | for (const char *p = answer; p < end && *p; p++) { |
| 2981 | char c = (char)toupper((unsigned char)*p); |
| 2982 | if (c >= 'A' && c <= max_answer) { |
| 2983 | char before = p == visible ? ' ' : p[-1]; |
| 2984 | char after = p[1]; |
| 2985 | if (!is_letter_boundary(before, after)) continue; |
| 2986 | /* A standalone capital that begins a same-line English word |
| 2987 | * ("A careful ...") or a contraction ("I'll ...") is prose, |
| 2988 | * not the model's pick: the real letter comes later on the |
| 2989 | * line. Skip it; the reverse scan below still recovers it if |
| 2990 | * it was the only candidate (e.g. "Answer: A is correct"). */ |
| 2991 | if (after == '\'') continue; |
no test coverage detected