diff options
Diffstat (limited to 'libf2c/libI77')
-rw-r--r-- | libf2c/libI77/Version.c | 11 | ||||
-rw-r--r-- | libf2c/libI77/endfile.c | 3 | ||||
-rw-r--r-- | libf2c/libI77/sfe.c | 4 |
3 files changed, 16 insertions, 2 deletions
diff --git a/libf2c/libI77/Version.c b/libf2c/libI77/Version.c index 67d88453b37..fe3c959bc25 100644 --- a/libf2c/libI77/Version.c +++ b/libf2c/libI77/Version.c @@ -1,4 +1,4 @@ -static char junk[] = "\n@(#) LIBI77 VERSION pjw,dmg-mods 19990627\n"; +static char junk[] = "\n@(#) LIBI77 VERSION pjw,dmg-mods 19991115\n"; /* */ @@ -305,6 +305,15 @@ wrtfmt.c: /* 27 June 1999: rsne.c: fix bug in namelist input: a misplaced increment */ /* could cause wrong array elements to be assigned; e.g., */ /* "&input k(5)=10*1 &end" assigned k(5) and k(15..23) */ +/* 15 Nov. 1999: endfile.c: set state to writing (b->uwrt = 1) when an */ +/* endfile statement requires copying the file. */ +/* (Otherwise an immediately following rewind statement */ +/* could make the file appear empty.) Also, supply a */ +/* missing (long) cast in the sprintf call. */ +/* sfe.c: add #ifdef ALWAYS_FLUSH logic, for formatted I/O: */ +/* Compiling libf2c with -DALWAYS_FLUSH should prevent losing */ +/* any data in buffers should the program fault. It also */ +/* makes the program run more slowly. */ diff --git a/libf2c/libI77/endfile.c b/libf2c/libI77/endfile.c index 0e4ac0318e9..f7a78e12555 100644 --- a/libf2c/libI77/endfile.c +++ b/libf2c/libI77/endfile.c @@ -29,7 +29,7 @@ integer f_end(alist *a) b = &f__units[a->aunit]; if(b->ufd==NULL) { char nbuf[10]; - sprintf(nbuf,"fort.%ld",a->aunit); + sprintf(nbuf,"fort.%ld",(long)a->aunit); if (tf = fopen(nbuf, f__w_mode[0])) fclose(tf); return(0); @@ -103,6 +103,7 @@ t_runc(alist *a) rewind(tf); if (copy(tf, loc, bf)) goto bad1; + b->uwrt = 1; b->urw = 2; #ifdef NON_UNIX_STDIO if (b->ufmt) { diff --git a/libf2c/libI77/sfe.c b/libf2c/libI77/sfe.c index f7c3b83b734..77ade5b5a7f 100644 --- a/libf2c/libI77/sfe.c +++ b/libf2c/libI77/sfe.c @@ -30,5 +30,9 @@ integer e_wsfe(Void) f__init = 1; n = en_fio(); f__fmtbuf=NULL; +#ifdef ALWAYS_FLUSH + if (!n && fflush(f__cf)) + err(f__elist->cierr, errno, "write end"); +#endif return n; } |