projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Did some more work on bug 12859 and then realized that a *good*
[pspp]
/
src
/
vector.c
diff --git
a/src/vector.c
b/src/vector.c
index 99b3423af1467ff1aea250bd73221749bb3e88bc..558db4e047b055aac0d356abdf27e3e667576b2b 100644
(file)
--- a/
src/vector.c
+++ b/
src/vector.c
@@
-14,14
+14,15
@@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 5
9 Temple Place - Suite 330
, Boston, MA
- 0211
1-1307
, USA. */
+ Foundation, Inc., 5
1 Franklin Street, Fifth Floor
, Boston, MA
+ 0211
0-1301
, USA. */
#include <config.h>
#include <config.h>
-#include
<assert.h>
+#include
"error.h"
#include <stdlib.h>
#include "alloc.h"
#include "command.h"
#include <stdlib.h>
#include "alloc.h"
#include "command.h"
+#include "dictionary.h"
#include "error.h"
#include "lexer.h"
#include "misc.h"
#include "error.h"
#include "lexer.h"
#include "misc.h"
@@
-61,7
+62,7
@@
cmd_vector (void)
}
for (cp2 = cp; cp2 < cp; cp2 += strlen (cp))
}
for (cp2 = cp; cp2 < cp; cp2 += strlen (cp))
- if (!strcmp (cp2, tokid))
+ if (!strc
asec
mp (cp2, tokid))
{
msg (SE, _("Vector name %s is given twice."), tokid);
goto fail;
{
msg (SE, _("Vector name %s is given twice."), tokid);
goto fail;
@@
-91,8
+92,8
@@
cmd_vector (void)
{
/* There's more than one vector name. */
msg (SE, _("A slash must be used to separate each vector "
{
/* There's more than one vector name. */
msg (SE, _("A slash must be used to separate each vector "
- "specification when using the long form. Commands "
- "such as VECTOR A,B=Q1 TO Q20 are not supported."));
+
"specification when using the long form. Commands "
+
"such as VECTOR A,B=Q1 TO Q20 are not supported."));
goto fail;
}
goto fail;
}
@@
-112,7
+113,7
@@
cmd_vector (void)
int ndig;
/* Name of an individual variable to be created. */
int ndig;
/* Name of an individual variable to be created. */
- char name[
9
];
+ char name[
SHORT_NAME_LEN + 1
];
/* Vector variables. */
struct variable **v;
/* Vector variables. */
struct variable **v;
@@
-130,13
+131,13
@@
cmd_vector (void)
if (!lex_force_match (')'))
goto fail;
if (!lex_force_match (')'))
goto fail;
- /* First check that all the generated variable names
are 8
- characters or shorter. */
+ /* First check that all the generated variable names
+
are LONG_NAME_LEN
characters or shorter. */
ndig = intlog10 (nv);
for (cp = vecnames; *cp;)
{
int len = strlen (cp);
ndig = intlog10 (nv);
for (cp = vecnames; *cp;)
{
int len = strlen (cp);
- if (len + ndig >
8
)
+ if (len + ndig >
LONG_NAME_LEN
)
{
msg (SE, _("%s%d is too long for a variable name."), cp, nv);
goto fail;
{
msg (SE, _("%s%d is too long for a variable name."), cp, nv);
goto fail;
@@
-152,7
+153,8
@@
cmd_vector (void)
sprintf (name, "%s%d", cp, i + 1);
if (dict_lookup_var (default_dict, name))
{
sprintf (name, "%s%d", cp, i + 1);
if (dict_lookup_var (default_dict, name))
{
- msg (SE, _("There is already a variable named %s."), name);
+ msg (SE, _("There is already a variable named %s."),
+ name);
goto fail;
}
}
goto fail;
}
}