projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update to-do list.
[pspp]
/
src
/
data
/
any-writer.c
diff --git
a/src/data/any-writer.c
b/src/data/any-writer.c
index c5d741a28a800d92efeed76d151492ebbfc7d321..5c3c0aee0f9f22fa91ef2593ae9dc7bf44f1fb34 100644
(file)
--- a/
src/data/any-writer.c
+++ b/
src/data/any-writer.c
@@
-26,7
+26,7
@@
#include <stdlib.h>
#include <libpspp/message.h>
#include "file-handle-def.h"
#include <stdlib.h>
#include <libpspp/message.h>
#include "file-handle-def.h"
-#include "filename.h"
+#include "file
-
name.h"
#include "por-file-writer.h"
#include "sys-file-writer.h"
#include <libpspp/str.h>
#include "por-file-writer.h"
#include "sys-file-writer.h"
#include <libpspp/str.h>
@@
-62,7
+62,7
@@
any_writer_open (struct file_handle *handle, struct dictionary *dict)
struct any_writer *writer;
char *extension;
struct any_writer *writer;
char *extension;
- extension = fn_extension (fh_get_filename (handle));
+ extension = fn_extension (fh_get_file
_
name (handle));
str_lowercase (extension);
if (!strcmp (extension, ".por"))
str_lowercase (extension);
if (!strcmp (extension, ".por"))
@@
-189,21
+189,29
@@
any_writer_error (const struct any_writer *writer)
bool
any_writer_close (struct any_writer *writer)
{
bool
any_writer_close (struct any_writer *writer)
{
+ bool ok;
+
if (writer == NULL)
return true;
switch (writer->type)
{
case SYSTEM_FILE:
if (writer == NULL)
return true;
switch (writer->type)
{
case SYSTEM_FILE:
- return sfm_close_writer (writer->private);
+ ok = sfm_close_writer (writer->private);
+ break;
case PORTABLE_FILE:
case PORTABLE_FILE:
- return pfm_close_writer (writer->private);
+ ok = pfm_close_writer (writer->private);
+ break;
case SCRATCH_FILE:
case SCRATCH_FILE:
- return scratch_writer_close (writer->private);
-
+ ok = scratch_writer_close (writer->private);
+ break;
+
default:
abort ();
}
default:
abort ();
}
+
+ free (writer);
+ return ok;
}
}