projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
output: Implement nested tables.
[pspp]
/
src
/
output
/
driver.c
diff --git
a/src/output/driver.c
b/src/output/driver.c
index acc58cf999cdd7b77d533f54edc9ce17db954550..0a6afba98a5d7eeec20b1060217a1ea65e643296 100644
(file)
--- a/
src/output/driver.c
+++ b/
src/output/driver.c
@@
-1,5
+1,5
@@
/* PSPP - a program for statistical analysis.
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2007, 2009, 2010, 2011
, 2012
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
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
@@
-38,7
+38,6
@@
#include "output/output-item.h"
#include "output/text-item.h"
#include "output/output-item.h"
#include "output/text-item.h"
-#include "gl/error.h"
#include "gl/xalloc.h"
#include "gl/xmemdup0.h"
#include "gl/xalloc.h"
#include "gl/xmemdup0.h"
@@
-294,16
+293,23
@@
output_driver_create (struct string_map *options)
char *file_name;
char *format;
char *file_name;
char *format;
+ format = string_map_find_and_delete (options, "format");
file_name = string_map_find_and_delete (options, "output-file");
file_name = string_map_find_and_delete (options, "output-file");
- if (file_name == NULL)
- file_name = xstrdup ("-");
- format = string_map_find_and_delete (options, "format");
if (format == NULL)
{
if (format == NULL)
{
- const char *extension = strrchr (file_name, '.');
- format = xstrdup (extension != NULL ? extension + 1 : "");
+ if (file_name != NULL)
+ {
+ const char *extension = strrchr (file_name, '.');
+ format = xstrdup (extension != NULL ? extension + 1 : "");
+ }
+ else
+ format = xstrdup ("txt");
}
}
+ f = find_factory (format);
+
+ if (file_name == NULL)
+ file_name = xstrdup (f->default_file_name);
/* XXX should use parse_enum(). */
device_string = string_map_find_and_delete (options, "device");
/* XXX should use parse_enum(). */
device_string = string_map_find_and_delete (options, "device");
@@
-315,12
+321,11
@@
output_driver_create (struct string_map *options)
device_type = SETTINGS_DEVICE_LISTING;
else
{
device_type = SETTINGS_DEVICE_LISTING;
else
{
-
error (0, 0
, _("%s is not a valid device type (the choices are `%s' and `%s')"),
+
msg (MW
, _("%s is not a valid device type (the choices are `%s' and `%s')"),
device_string, "terminal", "listing");
device_type = default_device_type (file_name);
}
device_string, "terminal", "listing");
device_type = default_device_type (file_name);
}
- f = find_factory (format);
driver = f->create (file_name, device_type, options);
if (driver != NULL)
{
driver = f->create (file_name, device_type, options);
if (driver != NULL)
{
@@
-328,7
+333,7
@@
output_driver_create (struct string_map *options)
const char *key;
STRING_MAP_FOR_EACH_KEY (key, node, options)
const char *key;
STRING_MAP_FOR_EACH_KEY (key, node, options)
-
error (0, 0
, _("%s: unknown option `%s'"), file_name, key);
+
msg (MW
, _("%s: unknown option `%s'"), file_name, key);
}
string_map_clear (options);
}
string_map_clear (options);