497 |
if (match (r, '6')) |
if (match (r, '6')) |
498 |
{ |
{ |
499 |
weight_name = read_pool_string (r); |
weight_name = read_pool_string (r); |
500 |
if (strlen (weight_name) > 8) |
if (strlen (weight_name) > SHORT_NAME_LEN) |
501 |
error (r, _("Weight variable name (%s) truncated."), weight_name); |
error (r, _("Weight variable name (%s) truncated."), weight_name); |
502 |
} |
} |
503 |
|
|
520 |
read_string (r, name); |
read_string (r, name); |
521 |
for (j = 0; j < 6; j++) |
for (j = 0; j < 6; j++) |
522 |
fmt[j] = read_int (r); |
fmt[j] = read_int (r); |
523 |
|
#if 0 |
524 |
|
/* Weirdly enough, there is no # character in the SPSS portable |
525 |
|
character set, so we can't check for it. */ |
526 |
|
if (strlen (name) > SHORT_NAME_LEN) |
527 |
|
lose ((r, _("position %d: Variable name has %u characters."), |
528 |
|
i, strlen (name))); |
529 |
|
if ((name[0] < 74 /* A */ || name[0] > 125 /* Z */) |
530 |
|
&& name[0] != 152 /* @ */) |
531 |
|
lose ((r, _("position %d: Variable name begins with invalid " |
532 |
|
"character."), i)); |
533 |
|
if (name[0] >= 100 /* a */ && name[0] <= 125 /* z */) |
534 |
|
{ |
535 |
|
corrupt_msg (r, _("position %d: Variable name begins with " |
536 |
|
"lowercase letter %c."), |
537 |
|
i, name[0] - 100 + 'a'); |
538 |
|
name[0] -= 26 /* a - A */; |
539 |
|
} |
540 |
|
|
541 |
|
/* Verify remaining characters of variable name. */ |
542 |
|
for (j = 1; j < (int) strlen (name); j++) |
543 |
|
{ |
544 |
|
int c = name[j]; |
545 |
|
#endif |
546 |
if (!var_is_valid_name (name, false) || *name == '#') |
if (!var_is_valid_name (name, false) || *name == '#') |
547 |
error (r, _("position %d: Invalid variable name `%s'."), name); |
error (r, _("position %d: Invalid variable name `%s'."), name); |
548 |
st_uppercase (name); |
st_uppercase (name); |