| 71 | /* ── stdin ────────────────────────────────────────────────────────── */ |
| 72 | |
| 73 | static char *ha_read_stdin(void) { |
| 74 | char *buf = malloc(HA_STDIN_CAP + 1); |
| 75 | if (!buf) { |
| 76 | return NULL; |
| 77 | } |
| 78 | size_t total = 0; |
| 79 | size_t n; |
| 80 | while (total < HA_STDIN_CAP && (n = fread(buf + total, 1, HA_STDIN_CAP - total, stdin)) > 0) { |
| 81 | total += n; |
| 82 | } |
| 83 | buf[total] = '\0'; |
| 84 | return buf; |
| 85 | } |
| 86 | |
| 87 | /* ── pattern → token ────────────────────────────────────────────── |
| 88 | * Extract the longest identifier-like run ([A-Za-z_][A-Za-z0-9_]*) of at |
no outgoing calls
no test coverage detected