projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updated the Lithuanian translation from http://translationproject.org.
[pspp]
/
src
/
language
/
dictionary
/
mrsets.c
diff --git
a/src/language/dictionary/mrsets.c
b/src/language/dictionary/mrsets.c
index c775f49784eab659d715cc0bb2408a7c20ad21aa..f607ac928f4f48039183569e5ea6d235a0344a62 100644
(file)
--- a/
src/language/dictionary/mrsets.c
+++ b/
src/language/dictionary/mrsets.c
@@
-1,5
+1,5
@@
/* PSPP - a program for statistical analysis.
/* PSPP - a program for statistical analysis.
- Copyright (C) 2010 Free Software Foundation, Inc.
+ Copyright (C) 2010
, 2011
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
@@
-17,9
+17,9
@@
#include <config.h>
#include "data/data-out.h"
#include <config.h>
#include "data/data-out.h"
+#include "data/dataset.h"
#include "data/dictionary.h"
#include "data/mrset.h"
#include "data/dictionary.h"
#include "data/mrset.h"
-#include "data/procedure.h"
#include "data/value-labels.h"
#include "data/variable.h"
#include "language/command.h"
#include "data/value-labels.h"
#include "data/variable.h"
#include "language/command.h"
@@
-27,6
+27,7
@@
#include "language/lexer/variable-parser.h"
#include "libpspp/assertion.h"
#include "libpspp/hmap.h"
#include "language/lexer/variable-parser.h"
#include "libpspp/assertion.h"
#include "libpspp/hmap.h"
+#include "libpspp/i18n.h"
#include "libpspp/message.h"
#include "libpspp/str.h"
#include "libpspp/stringi-map.h"
#include "libpspp/message.h"
#include "libpspp/str.h"
#include "libpspp/stringi-map.h"
@@
-69,7
+70,7
@@
cmd_mrsets (struct lexer *lexer, struct dataset *ds)
return CMD_FAILURE;
}
return CMD_FAILURE;
}
- return
lex_end_of_command (lexer)
;
+ return
CMD_SUCCESS
;
}
static bool
}
static bool
@@
-91,15
+92,10
@@
parse_group (struct lexer *lexer, struct dictionary *dict,
{
if (lex_match_id (lexer, "NAME"))
{
{
if (lex_match_id (lexer, "NAME"))
{
- if (!lex_force_match (lexer, T_EQUALS) || !lex_force_id (lexer))
+ if (!lex_force_match (lexer, T_EQUALS) || !lex_force_id (lexer)
+ || !mrset_is_valid_name (lex_tokcstr (lexer),
+ dict_get_encoding (dict), true))
goto error;
goto error;
- if (lex_tokcstr (lexer)[0] != '$')
- {
- msg (SE, _("%s is not a valid name for a multiple response "
- "set. Multiple response set names must begin with "
- "`$'."), lex_tokcstr (lexer));
- goto error;
- }
free (mrset->name);
mrset->name = xstrdup (lex_tokcstr (lexer));
free (mrset->name);
mrset->name = xstrdup (lex_tokcstr (lexer));
@@
-159,12
+155,15
@@
parse_group (struct lexer *lexer, struct dictionary *dict,
}
else if (lex_is_string (lexer))
{
}
else if (lex_is_string (lexer))
{
- const char *s = lex_tokcstr (lexer);
- int width;
+ size_t width;
+ char *s;
+
+ s = recode_string (dict_get_encoding (dict), "UTF-8",
+ lex_tokcstr (lexer), -1);
+ width = strlen (s);
/* Trim off trailing spaces, but don't trim the string until
it's empty because a width of 0 is a numeric type. */
/* Trim off trailing spaces, but don't trim the string until
it's empty because a width of 0 is a numeric type. */
- width = strlen (s);
while (width > 1 && s[width - 1] == ' ')
width--;
while (width > 1 && s[width - 1] == ' ')
width--;
@@
-172,6
+171,8
@@
parse_group (struct lexer *lexer, struct dictionary *dict,
value_init (&mrset->counted, width);
memcpy (value_str_rw (&mrset->counted, width), s, width);
mrset->width = width;
value_init (&mrset->counted, width);
memcpy (value_str_rw (&mrset->counted, width), s, width);
mrset->width = width;
+
+ free (s);
}
else
{
}
else
{
@@
-536,8
+537,8
@@
parse_display (struct lexer *lexer, struct dictionary *dict)
if (n == 0)
{
if (dict_get_n_mrsets (dict) == 0)
if (n == 0)
{
if (dict_get_n_mrsets (dict) == 0)
- msg (SN, _("The active
file dictionary does not contain any multiple
"
- "response sets."));
+ msg (SN, _("The active
dataset dictionary does not contain any
"
+ "
multiple
response sets."));
stringi_set_destroy (&mrset_names_set);
return true;
}
stringi_set_destroy (&mrset_names_set);
return true;
}