#define CFG_FATAL(body) \
do { \
- fprintf (stderr, "%s:%s:%d: ", program, fname, line); \
+ fprintf (stderr, "%s:%s:%d: ", program, buffer_ptr(&fname), line); \
fprintf body; \
fprintf (stderr, "\n"); \
fflush (stderr); \
fp = fopen (buffer_ptr (&fname), "r");
- buffer_uninit (&fname);
+ /* We wait to uninit the buffer so that CFG_FATAL can use it. */
if (fp == NULL)
- return 0;
+ {
+ buffer_uninit (&fname);
+ return 0;
+ }
while (fgets (buf, sizeof (buf), fp))
{
else
CFG_FATAL ((stderr, _("illegal option: %s"), token));
}
+
+ fclose (fp);
+ buffer_uninit (&fname);
return 1;
}