#include "data/any-writer.h"
-#include <assert.h>
#include <errno.h>
#include <stdbool.h>
#include <stdio.h>
#include "gettext.h"
#define _(msgid) gettext (msgid)
-/* Creates and returns a writer for HANDLE with the given DICT. */
+/* Creates and returns a writer for HANDLE with the given DICT. The caller
+ retains ownership of DICT, which might get modified to assign short names. */
struct casewriter *
any_writer_open (struct file_handle *handle, struct dictionary *dict)
{
struct casewriter *writer;
char *extension;
- extension = fn_extension (fh_get_file_name (handle));
+ extension = fn_extension (handle);
str_lowercase (extension);
if (!strcmp (extension, ".por"))