🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.notes
Article #125

Bug in gtext.c - (nf)

#125
From: utzoodecvaxharpoesquirecmcl2salk...
Date: Fri, 07 Jan 1983 00:11
35 lines
1336 bytes
#N:cmcl2:12700002:000:932
cmcl2!salkind    Jan  6 13:49:00 1983

Pardon me if this has already been fixed, but I've been away from
the notes scene for a while.

After editing text, an open file descriptor is never closed again.
This causes notes to run out of file descriptors and lock up after
invoking the editor about 14 times.

Here is a diff of the fix:

*** gtext.c.dist	Fri Jun 18 12:48:52 1982
--- gtext.c	Thu Jan  6 13:30:20 1983
***************
*** 47,52
      x ((scr = fopen (fn, "r")) == NULL, "gettext: scratch file");
  
      c = pagein (io, scr, where);			/* move text in */
      x (unlink (fn) < 0, "gettext: unlink");
      return c;						/* return count of characters moved */
  }

--- 47,53 -----
      x ((scr = fopen (fn, "r")) == NULL, "gettext: scratch file");
  
      c = pagein (io, scr, where);			/* move text in */
+     fclose (scr);
      x (unlink (fn) < 0, "gettext: unlink");
      return c;						/* return count of characters moved */
  }

-----

	Lou Salkind
Technical Details
Message-ID: <bnews.cmcl2.26747>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
From: utzoo!decvax!harpo!esquire!cmcl2!salkind
Newsgroups: net.notes
Title: Bug in gtext.c - (nf)
Article-I.D.: cmcl2.26747
Posted: Fri Jan  7 00:11:34 1983
Received: Fri Jan  7 06:25:22 1983
Subject: Bug in gtext.c - (nf)
Date: Fri, 07 Jan 1983 00:11:34 +0000
Message-ID: <bnews.cmcl2.26747>