aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2012-05-29 18:23:10 +0200
committerThomas White <taw@physics.org>2012-05-29 18:23:10 +0200
commitc2d6b10c8d1a1fffe556c58d9bb12738f847d208 (patch)
treed321effe7eff4b8f4b56b7e56627a983543f7670 /src
parentd9a6df9abf1cf38a3ae821911330f36f336ea4de (diff)
Handle the end of the file list cleanly
Diffstat (limited to 'src')
-rw-r--r--src/indexamajig.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/indexamajig.c b/src/indexamajig.c
index aab6a0eb..3c7b0cb9 100644
--- a/src/indexamajig.c
+++ b/src/indexamajig.c
@@ -473,8 +473,13 @@ static void run_work(const struct index_args *iargs,
rval = fgets(line, 1023, fh);
if ( rval == NULL ) {
free(line);
- ERROR("Read error!\n");
- return;
+ if ( feof(fh) ) {
+ allDone = 1;
+ continue;
+ } else {
+ ERROR("Read error!\n");
+ return;
+ }
}
chomp(line);