summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--storeio/dev.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/storeio/dev.c b/storeio/dev.c
index f82200e8..9a9694b2 100644
--- a/storeio/dev.c
+++ b/storeio/dev.c
@@ -1,6 +1,6 @@
/* store `device' I/O
- Copyright (C) 1995,96,98,99,2000,2001 Free Software Foundation, Inc.
+ Copyright (C) 1995,96,98,99,2000,01,02 Free Software Foundation, Inc.
Written by Miles Bader <miles@gnu.org>
This program is free software; you can redistribute it and/or
@@ -433,6 +433,13 @@ dev_read (struct dev *dev, off_t offs, size_t whole_amount,
}
}
+ if (dev->store->size > 0 && offs == dev->store->size)
+ {
+ /* Reading end of file. */
+ *len = 0;
+ return 0;
+ }
+
if (dev->inhibit_cache)
{
/* Under --no-cache, we permit only whole-block reads.