projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
PsppireVarView: Use g_realloc instead of xrealloc
[pspp]
/
src
/
language
/
dictionary
/
vector.c
diff --git
a/src/language/dictionary/vector.c
b/src/language/dictionary/vector.c
index b0d696154b7f212a5c790a87efe7d69b1debd31a..28e97b15d8aa9643475dfdbbcd1d964d164ebc3c 100644
(file)
--- a/
src/language/dictionary/vector.c
+++ b/
src/language/dictionary/vector.c
@@
-1,5
+1,5
@@
/* PSPP - a program for statistical analysis.
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2010, 2011
, 2012, 2016
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
@@
-27,6
+27,7
@@
#include "language/lexer/lexer.h"
#include "language/lexer/variable-parser.h"
#include "libpspp/assertion.h"
#include "language/lexer/lexer.h"
#include "language/lexer/variable-parser.h"
#include "libpspp/assertion.h"
+#include "libpspp/i18n.h"
#include "libpspp/message.h"
#include "libpspp/misc.h"
#include "libpspp/pool.h"
#include "libpspp/message.h"
#include "libpspp/misc.h"
#include "libpspp/pool.h"
@@
-68,7
+69,7
@@
cmd_vector (struct lexer *lexer, struct dataset *ds)
}
for (i = 0; i < vector_cnt; i++)
}
for (i = 0; i < vector_cnt; i++)
- if (!strcasecmp (vectors[i], lex_tokcstr (lexer)))
+ if (!
utf8_
strcasecmp (vectors[i], lex_tokcstr (lexer)))
{
msg (SE, _("Vector name %s is given twice."),
lex_tokcstr (lexer));
{
msg (SE, _("Vector name %s is given twice."),
lex_tokcstr (lexer));
@@
-135,8
+136,7
@@
cmd_vector (struct lexer *lexer, struct dataset *ds)
{
seen_format = true;
if (!parse_format_specifier (lexer, &format)
{
seen_format = true;
if (!parse_format_specifier (lexer, &format)
- || !fmt_check_output (&format)
- || !fmt_check_type_compat (&format, VAL_NUMERIC))
+ || !fmt_check_output (&format))
goto fail;
}
else
goto fail;
}
else
@@
-167,8
+167,8
@@
cmd_vector (struct lexer *lexer, struct dataset *ds)
}
if (dict_lookup_var (dict, name))
{
}
if (dict_lookup_var (dict, name))
{
- free (name);
msg (SE, _("%s is an existing variable name."), name);
msg (SE, _("%s is an existing variable name."), name);
+ free (name);
goto fail;
}
free (name);
goto fail;
}
free (name);
@@
-183,7
+183,8
@@
cmd_vector (struct lexer *lexer, struct dataset *ds)
for (j = 0; j < var_cnt; j++)
{
char *name = xasprintf ("%s%d", vectors[i], j + 1);
for (j = 0; j < var_cnt; j++)
{
char *name = xasprintf ("%s%d", vectors[i], j + 1);
- vars[j] = dict_create_var_assert (dict, name, 0);
+ vars[j] = dict_create_var_assert (dict, name,
+ fmt_var_width (&format));
var_set_both_formats (vars[j], &format);
free (name);
}
var_set_both_formats (vars[j], &format);
free (name);
}