projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
SpreadLevel Plot: Don't try to take the logarithm of a negative
[pspp]
/
src
/
output
/
options.c
diff --git
a/src/output/options.c
b/src/output/options.c
index b8921255d3b08e59b592021b7a025f59f7af1e38..4a066de372075180eb55b408696532f0a1136da3 100644
(file)
--- a/
src/output/options.c
+++ b/
src/output/options.c
@@
-1,5
+1,5
@@
/* PSPP - a program for statistical analysis.
/* PSPP - a program for statistical analysis.
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009, 2010
, 2014
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
@@
-48,7
+48,7
@@
driver_option_create (const char *driver_name, const char *name,
o->driver_name = xstrdup (driver_name);
o->name = xstrdup (name);
o->value = value != NULL ? xstrdup (value) : NULL;
o->driver_name = xstrdup (driver_name);
o->name = xstrdup (name);
o->value = value != NULL ? xstrdup (value) : NULL;
- o->default_value =
xstrdup (default_value)
;
+ o->default_value =
default_value ? xstrdup (default_value) : NULL
;
return o;
}
return o;
}
@@
-228,7
+228,7
@@
parse_int (struct driver_option *o, int min_value, int max_value)
else if (max_value == INT_MAX)
{
if (min_value == 0)
else if (max_value == INT_MAX)
{
if (min_value == 0)
- msg (MW, _("%s: `%s' is `%s' but a nonnegative integer "
+ msg (MW, _("%s: `%s' is `%s' but a non
-
negative integer "
"is required"),
o->driver_name, o->name, o->value);
else if (min_value == 1)
"is required"),
o->driver_name, o->name, o->value);
else if (min_value == 1)
@@
-261,9
+261,9
@@
parse_dimension (struct driver_option *o)
{
int retval;
{
int retval;
- retval =
o->value != NULL ? measure_dimension (o->value) : -1;
-
if (retval == -1
)
-
retval = measure_dimension (o->default_value
);
+ retval =
(o->value != NULL ? measure_dimension (o->value)
+
: o->default_value != NULL ? measure_dimension (o->default_value
)
+
: -1
);
driver_option_destroy (o);
return retval;
driver_option_destroy (o);
return retval;