From 3ed58c281a6ad2071763bec4c2f82c75e28ee306 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Sun, 15 Nov 2020 07:54:09 +0300 Subject: [PATCH] mdbx-load: fix hang at EOF in the 'plain text' (i.e. no headers) mode. Related to https://github.com/erthink/libmdbx/issues/136 Change-Id: I6ac9762bc5ac6aaf8b947b2e4abb0b4ff6a14444 --- src/mdbx_load.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mdbx_load.c b/src/mdbx_load.c index ab93f916..c36b3096 100644 --- a/src/mdbx_load.c +++ b/src/mdbx_load.c @@ -780,6 +780,8 @@ int main(int argc, char *argv[]) { /* try read next header */ if (!(mode & NOHDR)) rc = readhdr(); + else if (ferror(stdin) || feof(stdin)) + break; } switch (rc) {