pwd = getpwnam (ds_cstr (&user_name));
if (pwd != NULL && pwd->pw_dir[0] != '\0')
{
- home = pwd->pw_dir;
+ home = xstrdup (pwd->pw_dir);
remainder = input + 1 + ds_length (&user_name);
}
ds_destroy (&user_name);
}
}
+static struct fmt_number_style *styles[FMT_NUMBER_OF_FORMATS];
+
/* Deinitialize the format module. */
void
fmt_done (void)
{
+ int t;
+ for (t = 0 ; t < FMT_NUMBER_OF_FORMATS ; ++t )
+ fmt_number_style_destroy (styles[t]);
}
/* Returns an input format specification with type TYPE, width W,
return map[bytes - 1];
}
\f
-static struct fmt_number_style *styles[FMT_NUMBER_OF_FORMATS];
/* Creates and returns a new struct fmt_number_style,
initializing all affixes to empty strings. */
assert (pool && file_name && mode);
f = fopen (file_name, mode);
- if (f == NULL)
- return NULL;
+ if (f != NULL)
+ pool_attach_file (pool, f);
return f;
}
#include <data/casefile.h>
#include <data/casefile-private.h>
#include <data/case.h>
+#include <libpspp/compiler.h>
struct class_flexifile
outp_done ();
msg_ui_done ();
+ fmt_done ();
}
exit (success ? EXIT_SUCCESS : EXIT_FAILURE);
}
#if HAVE_READLINE && unix
if (history_file != NULL)
write_history (history_file);
+ clear_history ();
+ free (history_file);
#endif
}
#endif
}
-#ifdef HAVE_READLINE
+#if HAVE_READLINE
static char *command_generator (const char *text, int state);
/* Returns a set of command name completions for TEXT.