Strip angle brackets from a system include path ( → stdio.h).
| 1150 | |
| 1151 | // Strip angle brackets from a system include path (<stdio.h> → stdio.h). |
| 1152 | static char *strip_angle_brackets(CBMArena *a, char *path) { |
| 1153 | if (path && path[0] == '<') { |
| 1154 | size_t len = strlen(path); |
| 1155 | if (len > SKIP_ONE && path[len - SKIP_ONE] == '>') { |
| 1156 | return cbm_arena_strndup(a, path + SKIP_ONE, len - PAIR_LEN); |
| 1157 | } |
| 1158 | } |
| 1159 | return path; |
| 1160 | } |
| 1161 | |
| 1162 | /* Node kinds that only group file-level items: the branches of `#if` / |
| 1163 | * `#ifdef` (an include guard is one) and the body of `extern "C" { ... }`. */ |
no test coverage detected