2 ** Splint - annotation-assisted static program checker
3 ** Copyright (C) 1994-2003 University of Virginia,
4 ** Massachusetts Institute of Technology
6 ** This program is free software; you can redistribute it and/or modify it
7 ** under the terms of the GNU General Public License as published by the
8 ** Free Software Foundation; either version 2 of the License, or (at your
9 ** option) any later version.
11 ** This program is distributed in the hope that it will be useful, but
12 ** WITHOUT ANY WARRANTY; without even the implied warranty of
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 ** General Public License for more details.
16 ** The GNU General Public License is available from http://www.gnu.org/ or
17 ** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
18 ** MA 02111-1307, USA.
20 ** For information on splint: info@splint.org
21 ** To report a bug: splint-bug@splint.org
22 ** For more information: http://www.splint.org
27 ** replaces filenamemap.c
28 ** based (loosely) on typeTable.c
30 ** entries in the fileTable are:
32 ** name - name of the file
33 ** type - kind of file (a temp file to be deleted?)
34 ** link - derived from this file
39 * - Added conditional stuff (macros OS2 and MSDOS) to make names of temporary
40 * files under Windows or OS/2 not larger than 8+3 characters to avoid
41 * trouble with FAT file systems or Novell Netware volumes.
42 * - Added include of new header file portab.h containing OS dependent stuff.
43 * - Changed occurance of '/' as path delimiter to a macro.
44 * - Added conditional stuff (#define and #include) for IBM's compiler.
47 # include <sys/types.h>
48 # include <sys/stat.h>
50 # include "splintMacros.nf"
56 # if defined(__IBMC__) && defined(OS2)
59 # define getpid _getpid
60 # define S_IRUSR S_IREAD
61 # define S_IWUSR S_IWRITE
62 # define S_IXUSR S_IEXEC
68 fileTable_addOpen (fileTable p_ft, /*@observer@*/ FILE *p_f, /*@only@*/ cstring p_fname)
71 static bool fileTable_inRange (fileTable ft, fileId fid) /*@*/
73 return (fileTable_isDefined (ft) && (fid >= 0) && (fid < ft->nentries));
76 static fileId fileTable_internAddEntry (fileTable p_ft, /*@only@*/ ftentry p_e)
78 static /*@only@*/ cstring makeTempName (cstring p_dir, cstring p_pre, cstring p_suf);
80 static /*@only@*/ cstring
81 fileType_unparse (fileType ft)
85 case FILE_NORMAL: return cstring_makeLiteral ("normal");
86 case FILE_NODELETE: return cstring_makeLiteral ("normal");
87 case FILE_LSLTEMP: return cstring_makeLiteral ("ltemp");
88 case FILE_HEADER: return cstring_makeLiteral ("header");
89 case FILE_XH: return cstring_makeLiteral ("xh");
90 case FILE_MACROS: return cstring_makeLiteral ("macros");
91 case FILE_METASTATE: return cstring_makeLiteral ("metastate");
98 fileTable_getIndex (fileTable ft, cstring s)
102 if (ft == NULL) return NOT_FOUND;
103 abspath = osd_absolutePath (cstring_undefined, s);
105 if (context_getFlag (FLG_CASEINSENSITIVEFILENAMES))
107 abspath = cstring_downcase (abspath);
110 DPRINTF (("Absolute path: %s: %s", s, abspath));
111 res = cstringTable_lookup (ft->htable, abspath);
112 cstring_free (abspath);
116 static cstring ftentry_unparse (fileTable ft, ftentry fte)
118 if (fileId_isValid (fte->fder))
120 llassert (fileTable_isDefined (ft));
122 return message ("%s %q %d (%s)",
124 fileType_unparse (fte->ftype),
126 ft->elements[fte->fder]->fname);
130 return message ("%s %q", fte->fname,
131 fileType_unparse (fte->ftype));
136 fileTable_unparse (fileTable ft)
138 cstring s = cstring_undefined;
141 if (fileTable_isUndefined (ft))
143 return (cstring_makeLiteral ("<fileTable undefined>"));
146 for (i = 0; i < ft->nentries; i++)
148 s = message ("%s\n[%d] %q", s, i, ftentry_unparse (ft, ft->elements[i]));
154 void fileTable_printTemps (fileTable ft)
156 if (fileTable_isDefined (ft))
160 for (i = 0; i < ft->nentries; i++)
162 if (ft->elements[i]->ftemp)
164 if (fileId_isValid (ft->elements[i]->fder))
166 fprintf (stderr, " %s:1\n\t%s:1\n",
167 cstring_toCharsSafe (ft->elements[ft->elements[i]->fder]->fname),
168 cstring_toCharsSafe (ft->elements[i]->fname));
172 fprintf (stderr, "[no file]\n\t%s:1\n",
173 cstring_toCharsSafe (ft->elements[i]->fname));
181 ** loads in fileTable from fileTable_dump
184 static /*@notnull@*/ ftentry
185 ftentry_create (/*@keep@*/ cstring tn, bool temp, fileType typ, fileId der)
187 ftentry t = (ftentry) dmalloc (sizeof (*t));
189 if (cstring_isUndefined (tn))
191 llbug (cstring_makeLiteral ("Undefined filename!"));
195 t->basename = cstring_undefined;
200 /* Don't set these until the basename is needed. */
208 ftentry_free (/*@only@*/ ftentry t)
210 cstring_free (t->fname);
211 cstring_free (t->basename);
215 /*@only@*/ /*@notnull@*/ fileTable
218 fileTable ft = (fileTable) dmalloc (sizeof (*ft));
221 ft->nspace = FTBASESIZE;
222 ft->elements = (ftentry *) dmalloc (FTBASESIZE * sizeof (*ft->elements));
223 ft->htable = cstringTable_create (FTHASHSIZE);
226 ft->nopenspace = FTBASESIZE;
227 ft->openelements = (foentry *) dmalloc (FTBASESIZE * sizeof (*ft->openelements));
234 fileTable_grow (fileTable ft)
239 llassert (fileTable_isDefined (ft));
241 ft->nspace = FTBASESIZE;
243 newent = (ftentry *) dmalloc ((ft->nentries + ft->nspace) * sizeof (*newent));
245 for (i = 0; i < ft->nentries; i++)
247 newent[i] = ft->elements[i];
250 sfree (ft->elements);
251 ft->elements = newent;
255 fileTable_growOpen (fileTable ft)
260 llassert (fileTable_isDefined (ft));
262 ft->nopenspace = FTBASESIZE;
264 newent = (foentry *) dmalloc ((ft->nopen + ft->nopenspace) * sizeof (*newent));
266 for (i = 0; i < ft->nopen; i++)
268 newent[i] = ft->openelements[i];
271 sfree (ft->openelements);
272 ft->openelements = newent;
276 fileTable_internAddEntry (fileTable ft, /*@only@*/ ftentry e)
278 llassert (fileTable_isDefined (ft));
285 DPRINTF (("Adding: %s", e->fname));
287 if (context_getFlag (FLG_CASEINSENSITIVEFILENAMES))
289 cstring sd = cstring_downcase (e->fname);
290 cstringTable_insert (ft->htable, sd, ft->nentries);
294 cstringTable_insert (ft->htable, cstring_copy (e->fname), ft->nentries);
298 Before, there was no cstring_copy above, and e->fname was free'd in the if branch.
299 Splint should have caught this, and produced a warning for this assignment.
302 ft->elements[ft->nentries] = e;
305 return (ft->nentries - 1);
308 void fileTable_noDelete (fileTable ft, cstring name)
310 fileId fid = fileTable_lookup (ft, name);
312 if (fileId_isValid (fid))
314 llassert (fileTable_isDefined (ft));
315 ft->elements[fid]->ftype = FILE_NODELETE;
319 DPRINTF (("Invalid no delete: %s", name));
324 fileTable_addFilePrim (fileTable ft, /*@temp@*/ cstring name,
325 bool temp, fileType typ, fileId der)
328 cstring absname = osd_absolutePath (NULL, name);
329 int tindex = fileTable_getIndex (ft, absname);
331 llassert (ft != fileTable_undefined);
333 if (tindex != NOT_FOUND)
335 llcontbug (message ("fileTable_addFilePrim: duplicate entry: %q", absname));
340 ftentry e = ftentry_create (absname, temp, typ, der);
342 if (der == fileId_invalid)
344 llassert (cstring_isUndefined (e->basename));
346 e->basename = fileLib_removePathFree (fileLib_removeAnyExtension (absname));
347 e->fsystem = context_isSystemDir (absname);
350 ** evans 2002-03-15: change suggested by Jim Zelenka
351 ** support relative paths for system directories
356 e->fsystem = context_isSystemDir (name);
359 e->fspecial = context_isSpecialFile (absname);
363 cstring srcname = cstring_concatFree1 (fileLib_removeAnyExtension (absname),
365 fileId fid = fileTable_lookup (ft, srcname);
366 cstring_free (srcname);
368 if (fileId_isValid (fid))
370 fileId derid = ft->elements[fid]->fder;
372 ft->elements[fid]->fspecial = TRUE;
374 if (fileId_isValid (derid))
376 ft->elements[derid]->fspecial = TRUE;
383 ftentry de = ft->elements[der];
385 llassert (cstring_isUndefined (e->basename));
386 e->basename = cstring_copy (de->basename);
387 e->fsystem = de->fsystem;
388 e->fspecial = de->fspecial;
391 return (fileTable_internAddEntry (ft, e));
396 fileTable_addFile (fileTable ft, cstring name)
398 return (fileTable_addFilePrim (ft, name, FALSE, FILE_NORMAL, fileId_invalid));
402 fileTable_addFileOnly (fileTable ft, /*@only@*/ cstring name)
404 fileId res = fileTable_addFilePrim (ft, name, FALSE, FILE_NORMAL, fileId_invalid);
410 fileTable_addHeaderFile (fileTable ft, cstring name)
413 res = fileTable_addFilePrim (ft, name, FALSE, FILE_HEADER, fileId_invalid);
419 fileTable_addStreamFile (fileTable ft, FILE *fstream, cstring name)
421 fileTable_addOpen (ft, fstream, cstring_copy (name));
425 fileTable_isHeader (fileTable ft, fileId fid)
427 if (fileId_isInvalid (fid))
432 llassert (fileTable_isDefined (ft) && fileTable_inRange (ft, fid));
433 return (ft->elements[fid]->ftype == FILE_HEADER);
437 fileTable_isSystemFile (fileTable ft, fileId fid)
439 if (fileId_isInvalid (fid))
444 llassert (fileTable_isDefined (ft) && fileTable_inRange (ft, fid));
445 return (ft->elements[fid]->fsystem);
449 fileTable_isXHFile (fileTable ft, fileId fid)
451 if (fileId_isInvalid (fid))
456 if (!(fileTable_isDefined (ft) && fileTable_inRange (ft, fid)))
458 llcontbug (message ("Bad file table or id: %s %d", bool_unparse (fileTable_isDefined (ft)), fid));
463 return (ft->elements[fid]->ftype == FILE_XH);
468 fileTable_isSpecialFile (fileTable ft, fileId fid)
470 if (fileId_isInvalid (fid))
475 llassert (fileTable_isDefined (ft) && fileTable_inRange (ft, fid));
476 return (ft->elements[fid]->fspecial);
480 fileTable_addLibraryFile (fileTable ft, cstring name)
482 return (fileTable_addFilePrim (ft, name, FALSE, FILE_HEADER, fileId_invalid));
486 fileTable_addXHFile (fileTable ft, cstring name)
488 return (fileTable_addFilePrim (ft, name, FALSE, FILE_XH, fileId_invalid));
492 fileTable_addImportFile (fileTable ft, cstring name)
494 return (fileTable_addFilePrim (ft, name, FALSE, FILE_HEADER, fileId_invalid));
498 fileTable_addLCLFile (fileTable ft, cstring name)
500 return (fileTable_addFilePrim (ft, name, FALSE, FILE_HEADER, fileId_invalid));
503 static int tmpcounter = 0;
506 fileTable_addMacrosFile (fileTable ft)
509 makeTempName (context_tmpdir (), cstring_makeLiteralTemp ("lmx"),
510 cstring_makeLiteralTemp (".llm"));
511 fileId res = fileTable_addFilePrim (ft, newname, TRUE, FILE_MACROS, fileId_invalid);
512 cstring_free (newname);
517 fileTable_addMetastateFile (fileTable ft, cstring name)
519 return (fileTable_addFilePrim (ft, name, FALSE, FILE_METASTATE, fileId_invalid));
523 fileTable_addCTempFile (fileTable ft, fileId fid)
526 makeTempName (context_tmpdir (), cstring_makeLiteralTemp ("cl"),
530 DPRINTF (("tmp dir: %s", context_tmpdir ()));
531 DPRINTF (("new name: %s", newname));
533 llassert (fileTable_isDefined (ft));
535 if (!fileId_isValid (ft->elements[fid]->fder))
537 if (fileTable_isXHFile (ft, fid))
539 res = fileTable_addFilePrim (ft, newname, TRUE, FILE_XH, fid);
543 res = fileTable_addFilePrim (ft, newname, TRUE, FILE_NORMAL, fid);
548 if (fileTable_isXHFile (ft, fid))
550 res = fileTable_addFilePrim (ft, newname, TRUE, FILE_XH,
551 ft->elements[fid]->fder);
555 res = fileTable_addFilePrim (ft, newname, TRUE, FILE_NORMAL,
556 ft->elements[fid]->fder);
560 DPRINTF (("Added file: %s", fileTable_fileName (res)));
561 cstring_free (newname);
566 fileTable_addltemp (fileTable ft)
568 cstring newname = makeTempName (context_tmpdir (),
569 cstring_makeLiteralTemp ("ls"),
570 cstring_makeLiteralTemp (".lsl"));
573 if (cstring_hasNonAlphaNumBar (newname))
575 char *lastpath = (char *)NULL;
581 ("Operating system generates tmp filename containing invalid charater: %s",
583 lldiagmsg (cstring_makeLiteral
584 ("Try cleaning up the tmp directory. Attempting to continue."));
588 llassert (cstring_isDefined (newname));
589 lastpath = strrchr (newname, CONNECTCHAR); /* get the directory */
590 llassert (lastpath != NULL);
593 newname = message ("%q%hlsl%d.lsl",
597 /*@noaccess cstring@*/
602 ** this is kind of yucky...need to make the result of cstring_fromChars
603 ** refer to the same storage as its argument. Of course, this loses,
604 ** since cstring is abstract. Should make it an only?
607 ret = fileTable_addFilePrim (ft, newname, TRUE, FILE_LSLTEMP, fileId_invalid);
608 cstring_free (newname);
613 fileTable_exists (fileTable ft, cstring s)
615 int tindex = fileTable_getIndex (ft, s);
617 if (tindex == NOT_FOUND)
619 DPRINTF (("Not found: %s", s));
629 fileTable_lookup (fileTable ft, cstring s)
631 int tindex = fileTable_getIndex (ft, s);
633 if (tindex == NOT_FOUND)
635 return fileId_invalid;
644 ** This is pretty awkward --- when we find the real path of
645 ** a .xh file, we may need to change the recorded name. [Sigh]
649 fileTable_setFilePath (fileTable ft, fileId fid, cstring path)
651 llassert (fileId_isValid (fid));
652 llassert (fileTable_isDefined (ft));
653 /* Need to put new string in hash table */
654 cstringTable_insert (ft->htable, cstring_copy (path), fid);
655 ft->elements[fid]->fname = cstring_copy (path);
659 fileTable_lookupBase (fileTable ft, cstring base)
663 if (context_getFlag (FLG_CASEINSENSITIVEFILENAMES))
665 cstring dbase = cstring_downcase (base);
666 tindex = fileTable_getIndex (ft, dbase);
667 cstring_free (dbase);
671 tindex = fileTable_getIndex (ft, base);
674 if (tindex == NOT_FOUND)
676 return fileId_invalid;
682 llassert (fileTable_isDefined (ft));
684 der = ft->elements[tindex]->fder;
686 if (!fileId_isValid (der))
696 fileTable_getName (fileTable ft, fileId fid)
698 if (!fileId_isValid (fid))
701 (message ("fileTable_getName: called with invalid type id: %d", fid));
702 return cstring_makeLiteralTemp ("<invalid>");
705 llassert (fileTable_isDefined (ft));
706 return (ft->elements[fid]->fname);
710 fileTable_getRootName (fileTable ft, fileId fid)
714 if (!fileId_isValid (fid))
716 llcontbug (message ("fileTable_getName: called with invalid id: %d", fid));
717 return cstring_makeLiteralTemp ("<invalid>");
720 if (!fileTable_isDefined (ft))
722 return cstring_makeLiteralTemp ("<no file table>");
725 fder = ft->elements[fid]->fder;
727 if (fileId_isValid (fder))
729 return (ft->elements[fder]->fname);
733 return (ft->elements[fid]->fname);
738 fileTable_getNameBase (fileTable ft, fileId fid)
740 if (!fileId_isValid (fid))
742 llcontbug (message ("fileTable_getName: called with invalid id: %d", fid));
743 return cstring_makeLiteralTemp ("<invalid>");
746 if (!fileTable_isDefined (ft))
748 return cstring_makeLiteralTemp ("<no file table>");
751 return (ft->elements[fid]->basename);
755 fileTable_sameBase (fileTable ft, fileId f1, fileId f2)
759 if (!fileId_isValid (f1))
764 if (!fileId_isValid (f2))
769 llassert (fileTable_isDefined (ft));
776 fd1 = ft->elements[f1]->fder;
778 if (!fileId_isValid (fd1))
783 fd2 = ft->elements[f2]->fder;
786 if (!fileId_isValid (fd2))
795 fileTable_cleanup (fileTable ft)
801 llassert (fileTable_isDefined (ft));
803 msg = ((ft->nentries > 40) && context_getFlag (FLG_SHOWSCAN));
804 skip = ft->nentries / 10;
808 (void) fflush (g_warningstream);
809 displayScanOpen (cstring_makeLiteral ("cleaning"));
812 for (i = 0; i < ft->nentries; i++)
814 ftentry fe = ft->elements[i];
818 /* let's be real careful now, hon! */
821 ** Make sure it is really a derived file
825 if (fe->ftype == FILE_LSLTEMP || fe->ftype == FILE_NODELETE)
827 ; /* already removed */
829 else if (fileId_isValid (fe->fder))
831 /*@i423 this should use close (fd) also... */
832 (void) osd_unlink (fe->fname);
834 else if (fe->ftype == FILE_MACROS)
836 (void) osd_unlink (fe->fname);
840 llbug (message ("Temporary file is not derivative: %s "
841 "(not deleted)", fe->fname));
849 if (msg && ((i % skip) == 0))
851 displayScanContinue (cstring_makeLiteral (i == 0 ? " " : "."));
862 fileTable_free (/*@only@*/ fileTable f)
866 if (f == (fileTable)NULL)
871 while ( i < f->nentries )
873 ftentry_free (f->elements[i]);
877 cstringTable_free (f->htable);
879 sfree (f->openelements); /*!! why didn't splint report this? */
884 ** unique temp filename are constructed from <dir><pre><pid><msg>.<suf>
885 ** requires: <dir> must end in '/'
888 static void nextMsg (char *msg)
918 llassertprint (FALSE, ("nextMsg: out of unique names!!!"));
926 static /*@only@*/ cstring makeTempName (cstring dir, cstring pre, cstring suf)
929 static /*@owned@*/ char *msg = NULL;
930 static /*@only@*/ cstring pidname = NULL;
934 llassert (cstring_length (pre) <= 3);
937 ** We limit the temp name to 8 characters:
945 msg = mstring_copy ("AAA"); /* there are 26^3 temp names */
950 /*@+matchanyintegral@*/
952 /*@=matchanyintegral@*/
955 if (cstring_isUndefined (pidname))
957 pidname = message ("%d", pid % 100);
960 maxlen = (cstring_length (dir) + cstring_length (pre) + mstring_length (msg)
961 + cstring_length (pidname) + cstring_length (suf) + 2);
963 DPRINTF (("Dir: %s / %s / %s / %s / %s",
964 dir, pre, pidname, msg, suf));
966 smsg = message ("%s%s%s%s%s", dir, pre, pidname, cstring_fromChars (msg), suf);
969 DPRINTF (("Trying: %s", smsg));
971 while (osd_fileExists (smsg))
974 smsg = message ("%s%s%s%s%s", dir, pre, pidname, cstring_fromChars (msg), suf);
982 foentry_create (/*@exposed@*/ FILE *f, /*@only@*/ cstring fname)
984 foentry t = (foentry) dmalloc (sizeof (*t));
991 foentry_free (/*@only@*/ foentry foe)
993 cstring_free (foe->fname);
998 fileTable_addOpen (fileTable ft, /*@observer@*/ FILE *f, /*@only@*/ cstring fname)
1000 llassert (fileTable_isDefined (ft));
1002 if (ft->nopenspace <= 0)
1004 fileTable_growOpen (ft);
1008 ft->openelements[ft->nopen] = foentry_create (f, fname);
1012 FILE *fileTable_createFile (fileTable ft, cstring fname)
1015 int fdesc = open (cstring_toCharsSafe (fname), O_WRONLY | O_CREAT | O_TRUNC | O_EXCL); /* not supported by VS.net: , S_IRUSR | S_IWUSR); */
1017 int fdesc = open (cstring_toCharsSafe (fname), O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, S_IRUSR | S_IWUSR);
1022 osd_setTempError ();
1023 llfatalerror (message ("Temporary file for "
1024 "pre-processor output already exists. Trying to "
1028 /*@notreached@*/ return NULL;
1032 FILE *res = fdopen (fdesc, "w");
1036 fileTable_addOpen (ft, res, cstring_copy (fname));
1037 DPRINTF (("Opening file: %s / %p", fname, res));
1041 DPRINTF (("Error opening: %s", fname));
1048 FILE *fileTable_createMacrosFile (fileTable ft, cstring fname)
1050 int fdesc = open (cstring_toCharsSafe (fname), O_RDWR | O_CREAT | O_TRUNC | O_EXCL, S_IRUSR | S_IWUSR);
1054 osd_setTempError ();
1055 llfatalerror (message ("Temporary file for "
1056 "pre-processor output already exists. Trying to "
1060 /*@notreached@*/ return NULL;
1064 FILE *res = fdopen (fdesc, "w+");
1068 fileTable_addOpen (ft, res, cstring_copy (fname));
1069 DPRINTF (("Opening file: %s / %p", fname, res));
1073 DPRINTF (("Error opening: %s", fname));
1080 FILE *fileTable_openReadFile (fileTable ft, cstring fname)
1082 FILE *res = fopen (cstring_toCharsSafe (fname), "r");
1086 fileTable_addOpen (ft, res, cstring_copy (fname));
1087 DPRINTF (("Opening read file: %s / %p", fname, res));
1091 DPRINTF (("Cannot open read file: %s", fname));
1098 ** Allows overwriting
1101 FILE *fileTable_openWriteFile (fileTable ft, cstring fname)
1103 FILE *res = fopen (cstring_toCharsSafe (fname), "w");
1106 fileTable_addOpen (ft, res, cstring_copy (fname));
1107 DPRINTF (("Opening file: %s / %p", fname, res));
1113 FILE *fileTable_openWriteUpdateFile (fileTable ft, cstring fname)
1115 FILE *res = fopen (cstring_toCharsSafe (fname), "w+");
1118 fileTable_addOpen (ft, res, cstring_copy (fname));
1119 DPRINTF (("Opening file: %s / %p", fname, res));
1125 bool fileTable_closeFile (fileTable ft, FILE *f)
1127 bool foundit = FALSE;
1130 llassert (fileTable_isDefined (ft));
1132 DPRINTF (("Closing file: %p", f));
1134 for (i = 0; i < ft->nopen; i++)
1136 if (ft->openelements[i]->f == f)
1138 DPRINTF (("Closing file: %p = %s", f, ft->openelements[i]->fname));
1140 if (i == ft->nopen - 1)
1142 foentry_free (ft->openelements[i]);
1143 ft->openelements[i] = NULL;
1147 foentry_free (ft->openelements[i]);
1148 ft->openelements[i] = ft->openelements[ft->nopen - 1];
1149 ft->openelements[ft->nopen - 1] = NULL;
1160 return (fclose (f) == 0);
1163 void fileTable_closeAll (fileTable ft)
1167 llassert (fileTable_isDefined (ft));
1169 for (i = 0; i < ft->nopen; i++)
1172 lldiagmsg (message ("Unclosed file at exit: %s", ft->openelements[i]->fname));
1175 if (ft->openelements[i]->f != NULL)
1177 (void) fclose (ft->openelements[i]->f); /* No check - cleaning up after errors */
1180 ft->openelements[i]->f = NULL;
1181 foentry_free (ft->openelements[i]);
1182 ft->openelements[i] = NULL;
1185 ft->nopenspace += ft->nopen;