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
/
variable-label.c
diff --git
a/src/language/dictionary/variable-label.c
b/src/language/dictionary/variable-label.c
index 4735047c1e6d20b7f28f2f01d37340cb8af209e8..c4e0df69fede265294c84ea60650e3fc14426145 100644
(file)
--- a/
src/language/dictionary/variable-label.c
+++ b/
src/language/dictionary/variable-label.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
, 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
@@
-19,13
+19,13
@@
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
-#include "data/procedure.h"
+#include "data/dataset.h"
+#include "data/dictionary.h"
#include "data/variable.h"
#include "language/command.h"
#include "language/lexer/lexer.h"
#include "language/lexer/variable-parser.h"
#include "libpspp/message.h"
#include "data/variable.h"
#include "language/command.h"
#include "language/lexer/lexer.h"
#include "language/lexer/variable-parser.h"
#include "libpspp/message.h"
-#include "libpspp/str.h"
#include "gl/xalloc.h"
#include "gl/xalloc.h"
@@
-35,15
+35,16
@@
int
cmd_variable_labels (struct lexer *lexer, struct dataset *ds)
{
int
cmd_variable_labels (struct lexer *lexer, struct dataset *ds)
{
+ struct dictionary *dict = dataset_dict (ds);
+
do
{
struct variable **v;
do
{
struct variable **v;
- struct string label;
size_t nv;
size_t i;
size_t nv;
size_t i;
- if (!parse_variables (lexer, d
ataset_dict (ds)
, &v, &nv, PV_NONE))
+ if (!parse_variables (lexer, d
ict
, &v, &nv, PV_NONE))
return CMD_FAILURE;
if (!lex_force_string (lexer))
return CMD_FAILURE;
if (!lex_force_string (lexer))
@@
-52,15
+53,8
@@
cmd_variable_labels (struct lexer *lexer, struct dataset *ds)
return CMD_FAILURE;
}
return CMD_FAILURE;
}
- ds_init_substring (&label, lex_tokss (lexer));
- if (ds_length (&label) > 255)
- {
- msg (SW, _("Truncating variable label to 255 characters."));
- ds_truncate (&label, 255);
- }
for (i = 0; i < nv; i++)
for (i = 0; i < nv; i++)
- var_set_label (v[i], ds_cstr (&label));
- ds_destroy (&label);
+ var_set_label (v[i], lex_tokcstr (lexer));
lex_get (lexer);
while (lex_token (lexer) == T_SLASH)
lex_get (lexer);
while (lex_token (lexer) == T_SLASH)