projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
removed "Written by..." line
[pspp-builds.git]
/
src
/
data
/
missing-values.c
diff --git
a/src/data/missing-values.c
b/src/data/missing-values.c
index b5f52f5e6985301b27066df9f7ab41b751ae69cf..ba9ab53b98d58d9545c183695a86123ad14fa421 100644
(file)
--- a/
src/data/missing-values.c
+++ b/
src/data/missing-values.c
@@
-1,6
+1,5
@@
/* PSPP - computes sample statistics.
Copyright (C) 2005 Free Software Foundation, Inc.
/* PSPP - computes sample statistics.
Copyright (C) 2005 Free Software Foundation, Inc.
- Written by Ben Pfaff <blp@gnu.org>.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@
-22,6
+21,7
@@
#include <assert.h>
#include <stdlib.h>
#include <libpspp/assertion.h>
#include <assert.h>
#include <stdlib.h>
#include <libpspp/assertion.h>
+#include "variable.h"
#include <libpspp/str.h>
#include <libpspp/str.h>
@@
-303,17
+303,20
@@
can_resize_string (const char *s, int old_width, int new_width)
contains only spaces in the characters that will be
trimmed. */
bool
contains only spaces in the characters that will be
trimmed. */
bool
-mv_is_resizable (const struct missing_values *mv, int width)
+mv_is_resizable (const struct missing_values *mv, int width)
{
{
- assert ((width == 0) == (mv->width == 0));
+ if ( var_type_from_width (width) != var_type_from_width (mv->width) )
+ return false;
+
if (width > MAX_SHORT_STRING && mv->type != MV_NONE)
return false;
if (width > MAX_SHORT_STRING && mv->type != MV_NONE)
return false;
- else if (width >= mv->width)
+
+ if (width >= mv->width)
return true;
return true;
- else
+ else
{
int i;
{
int i;
-
+
for (i = 0; i < 3; i++)
if (using_element (mv->type, i)
&& !can_resize_string (mv->values[i].s, mv->width, width))
for (i = 0; i < 3; i++)
if (using_element (mv->type, i)
&& !can_resize_string (mv->values[i].s, mv->width, width))