summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn van Groningen2013-03-13 14:02:48 +0000
committerJohn van Groningen2013-03-13 14:02:48 +0000
commita7235fae6f128e60319488f2821b0fd065aea190 (patch)
treef2d3819f551e4a5dcb89f4a33892d82c40ce4203
parentadd [rip] to a lea instruction (diff)
change result type of close_file to long,
decrement number_of_files if the file with the highest number is closed
-rw-r--r--ufileIO2.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ufileIO2.c b/ufileIO2.c
index 6c57ae1..b9804f4 100644
--- a/ufileIO2.c
+++ b/ufileIO2.c
@@ -389,7 +389,7 @@ long open_stderr (void)
return 0;
}
-int close_file (long fn)
+long close_file (long fn)
{
if (fn<FIRST_REAL_FILE){
if (fn==1){
@@ -422,6 +422,9 @@ int close_file (long fn)
f->file=NULL;
+ if (fn==number_of_files-1)
+ --number_of_files;
+
return result;
}
}