| ... | @@ -4417,22 +4417,14 @@ Buf *get_linux_libc_include_path(void) { | ... | @@ -4417,22 +4417,14 @@ Buf *get_linux_libc_include_path(void) { |
| 4417 | } | 4417 | } |
| 4418 | char *prev_newline = buf_ptr(out_stderr); | 4418 | char *prev_newline = buf_ptr(out_stderr); |
| 4419 | ZigList<const char *> search_paths = {}; | 4419 | ZigList<const char *> search_paths = {}; |
| 4420 | bool found_search_paths = false; | | |
| 4421 | for (;;) { | 4420 | for (;;) { |
| 4422 | char *newline = strchr(prev_newline, '\n'); | 4421 | char *newline = strchr(prev_newline, '\n'); |
| 4423 | if (newline == nullptr) { | 4422 | if (newline == nullptr) { |
| 4424 | zig_panic("unable to determine libc include path: bad output from C compiler command"); | 4423 | break; |
| 4425 | } | 4424 | } |
| 4426 | *newline = 0; | 4425 | *newline = 0; |
| 4427 | if (found_search_paths) { | 4426 | if (prev_newline[0] == ' ') { |
| 4428 | if (strcmp(prev_newline, "End of search list.") == 0) { | | |
| 4429 | break; | | |
| 4430 | } | | |
| 4431 | search_paths.append(prev_newline); | 4427 | search_paths.append(prev_newline); |
| 4432 | } else { | | |
| 4433 | if (strcmp(prev_newline, "#include <...> search starts here:") == 0) { | | |
| 4434 | found_search_paths = true; | | |
| 4435 | } | | |
| 4436 | } | 4428 | } |
| 4437 | prev_newline = newline + 1; | 4429 | prev_newline = newline + 1; |
| 4438 | } | 4430 | } |