Implemented long variable names a la spss V12.
[pspp-builds.git] / src / vector.c
index 99b3423af1467ff1aea250bd73221749bb3e88bc..9a0d749265529f92332a2877feb5a1ad1db9c225 100644 (file)
    02111-1307, USA. */
 
 #include <config.h>
-#include <assert.h>
+#include "error.h"
 #include <stdlib.h>
 #include "alloc.h"
 #include "command.h"
+#include "dictionary.h"
 #include "error.h"
 #include "lexer.h"
 #include "misc.h"
@@ -112,7 +113,7 @@ cmd_vector (void)
          int ndig;
 
          /* Name of an individual variable to be created. */
-         char name[9];
+         char name[SHORT_NAME_LEN + 1];
 
           /* Vector variables. */
           struct variable **v;
@@ -130,13 +131,13 @@ cmd_vector (void)
          if (!lex_force_match (')'))
            goto fail;
 
-         /* First check that all the generated variable names are 8
+         /* First check that all the generated variable names are SHORT_NAME_LEN
             characters or shorter. */
          ndig = intlog10 (nv);
          for (cp = vecnames; *cp;)
            {
              int len = strlen (cp);
-             if (len + ndig > 8)
+             if (len + ndig > SHORT_NAME_LEN)
                {
                  msg (SE, _("%s%d is too long for a variable name."), cp, nv);
                  goto fail;