fgetln is a BSDism; replace it with more portable code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89140 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c
index 1ef27e6..f5ddfa6 100644
--- a/tools/c-index-test/c-index-test.c
+++ b/tools/c-index-test/c-index-test.c
@@ -212,12 +212,15 @@
start_col = last_col = 1;
while (!feof(fp)) {
- size_t len;
- const char *buf;
-
- if ((buf = fgetln(fp, &len)) == NULL)
- break;
-
+ size_t len = 0;
+ int c;
+
+ while ((c = fgetc(fp)) != EOF) {
+ len++;
+ if (c == '\n')
+ break;
+ }
+
++line;
for (i = 0; i < len ; ++i) {