odt: Fix writing files with names different from pspp.odt.
[pspp-builds.git] / src / output / odt.c
index 47b8c43ea27a38e49e6366c2d129459fe6ff54fe..8883875297498cd45e0a870bf1ef46c5003f7126 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPP - a program for statistical analysis.
-   Copyright (C) 2009 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -293,7 +293,7 @@ odt_create (const char *name, enum output_device_type device_type,
   d = &odt->driver;
   output_driver_init (d, &odt_class, name, device_type);
 
-  odt->file_name = parse_string (opt (d, o, "output-file", "pspp.pdt"));
+  odt->file_name = parse_string (opt (d, o, "output-file", "pspp.odt"));
   odt->debug = parse_boolean (opt (d, o, "debug", "false"));
 
   odt->dirname = xstrdup ("odt-XXXXXX");
@@ -367,8 +367,8 @@ odt_destroy (struct output_driver *driver)
   /* Zip up the directory */
   ds_init_empty (&zip_cmd);
   ds_put_format (&zip_cmd,
-                "cd %s ; rm -f ../%s; zip -q -X ../%s mimetype; zip -q -X -u -r ../pspp.odt .",
-                odt->dirname, odt->file_name, odt->file_name);
+                "cd %s ; rm -f ../%s; zip -q -X ../%s mimetype; zip -q -X -u -r ../%s .",
+                odt->dirname, odt->file_name, odt->file_name, odt->file_name);
   system (ds_cstr (&zip_cmd));
   ds_destroy (&zip_cmd);