X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fvector.c;h=fc7a2dd317f6b4d04a1a4153351246228f76bb91;hb=d7b5d9144738a5a8989d45a01f4e458a78b68c0b;hp=2a712a6220c310e345433ac73e81ef8c8f7ef336;hpb=b321086267ad1014dc5d09886396cde30f094437;p=pspp diff --git a/src/vector.c b/src/vector.c index 2a712a6220..fc7a2dd317 100644 --- a/src/vector.c +++ b/src/vector.c @@ -14,8 +14,8 @@ 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., 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. */ #include #include "error.h" @@ -29,6 +29,9 @@ #include "str.h" #include "var.h" +#include "gettext.h" +#define _(msgid) gettext (msgid) + int cmd_vector (void) { @@ -62,7 +65,7 @@ cmd_vector (void) } for (cp2 = cp; cp2 < cp; cp2 += strlen (cp)) - if (!strcmp (cp2, tokid)) + if (!strcasecmp (cp2, tokid)) { msg (SE, _("Vector name %s is given twice."), tokid); goto fail; @@ -86,14 +89,14 @@ cmd_vector (void) { /* Long form. */ struct variable **v; - int nv; + size_t nv; if (strchr (vecnames, '\0')[1]) { /* 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; } @@ -113,7 +116,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; @@ -131,13 +134,13 @@ cmd_vector (void) 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); - 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; @@ -153,7 +156,8 @@ cmd_vector (void) 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; } }