parent
27fc49f72c
commit
291afcf75a
@ -4417,22 +4417,14 @@ Buf *get_linux_libc_include_path(void) {
|
|||||||
}
|
}
|
||||||
char *prev_newline = buf_ptr(out_stderr);
|
char *prev_newline = buf_ptr(out_stderr);
|
||||||
ZigList<const char *> search_paths = {};
|
ZigList<const char *> search_paths = {};
|
||||||
bool found_search_paths = false;
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
char *newline = strchr(prev_newline, '\n');
|
char *newline = strchr(prev_newline, '\n');
|
||||||
if (newline == nullptr) {
|
if (newline == nullptr) {
|
||||||
zig_panic("unable to determine libc include path: bad output from C compiler command");
|
|
||||||
}
|
|
||||||
*newline = 0;
|
|
||||||
if (found_search_paths) {
|
|
||||||
if (strcmp(prev_newline, "End of search list.") == 0) {
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
*newline = 0;
|
||||||
|
if (prev_newline[0] == ' ') {
|
||||||
search_paths.append(prev_newline);
|
search_paths.append(prev_newline);
|
||||||
} else {
|
|
||||||
if (strcmp(prev_newline, "#include <...> search starts here:") == 0) {
|
|
||||||
found_search_paths = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
prev_newline = newline + 1;
|
prev_newline = newline + 1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user