aboutsummaryrefslogtreecommitdiff
path: root/libf2c/libI77/err.c
diff options
context:
space:
mode:
Diffstat (limited to 'libf2c/libI77/err.c')
-rw-r--r--libf2c/libI77/err.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libf2c/libI77/err.c b/libf2c/libI77/err.c
index 1a204e820bc..d643d3b8b68 100644
--- a/libf2c/libI77/err.c
+++ b/libf2c/libI77/err.c
@@ -239,7 +239,13 @@ f__nowwriting (unit * x)
extern char *f__w_mode[];
if (x->urw & 2)
- goto done;
+ {
+ /* Not required according to C99 7.19.5.3, but
+ this really helps on Solaris. */
+ if (feof (x->ufd))
+ FSEEK (x->ufd, 0, SEEK_END);
+ goto done;
+ }
if (!x->ufnm)
goto cantwrite;
ufmt = x->url ? 0 : x->ufmt;