+2007-04-19 John Darrington <john@darrington.wattle.id.au>
+
+ * sys-file-reader.c: When reading a system file which has no
+ long name table, automatically create one where the long names
+ are the lower case versions of the short names.
+
2007-04-16 John Darrington <john@darrington.wattle.id.au>
* sys-file-reader.c: Some versions of Other Software seem to
int value_cnt; /* Number of 8-byte units per case. */
struct sfm_var *vars; /* Variables. */
size_t var_cnt; /* Number of variables. */
+ bool has_long_var_names; /* File has a long variable name map */
bool has_vls; /* File has one or more very long strings? */
/* Decompression. */
r->error = false;
r->value_cnt = 0;
r->has_vls = false;
+ r->has_long_var_names = false;
r->opcode_idx = sizeof r->opcodes;
if (setjmp (r->bail_out))
rec_type = read_int32 (r);
}
+
+ if ( ! r->has_long_var_names )
+ {
+ int i;
+ for (i = 0; i < dict_get_var_cnt (*dict); i++)
+ {
+ struct variable *var = dict_get_var (*dict, i);
+ char short_name [SHORT_NAME_LEN + 1];
+ char long_name [SHORT_NAME_LEN + 1];
+ char *s = short_name;
+ char *d = long_name;
+
+ strcpy (short_name, var_get_name (var));
+
+ strcpy (long_name, short_name);
+ str_lowercase (long_name);
+
+ /* Set long name. Renaming a variable may clear the short
+ name, but we want to retain it, so re-set it
+ explicitly. */
+ dict_rename_var (*dict, var, long_name);
+ var_set_short_name (var, short_name);
+ }
+
+ r->has_long_var_names = true;
+ }
+
/* Read record 999 data, which is just filler. */
read_int32 (r);
var_set_short_name (var, short_name);
}
close_variable_to_value_map (r, map);
+ r->has_long_var_names = true;
}
/* Reads record type 7, subtype 14, which gives the real length
+2007-04-19 John Darrington <john@darrington.wattle.id.au>
+
+ * tests/command/no_case_size.sh tests/command/sysfiles-old.sh :
+ Changed tests to reflect new behaviour (case changing) when
+ reading system files with no long name table.
+
2007-04-15 Ben Pfaff <blp@gnu.org>
* automake.mk: Add recode.sh to tests.
+--------+-------------------------------------------+--------+
|Variable|Description |Position|
#========#===========================================#========#
-|CONT |continents of the world | 1|
+|cont |continents of the world | 1|
| |Format: A32 | |
+--------+-------------------------------------------+--------+
-|SIZE |sq km | 2|
+|size |sq km | 2|
| |Format: F8.2 | |
+--------+-------------------------------------------+--------+
-|POP |population | 3|
+|pop |population | 3|
| |Format: F8.2 | |
+--------+-------------------------------------------+--------+
-|COUNT |number of countries | 4|
+|count |number of countries | 4|
| |Format: F8.2 | |
+--------+-------------------------------------------+--------+
- CONT SIZE POP COUNT
+ cont size pop count
-------------------------------- -------- -------- --------
Asia 44579000 3.7E+009 44.00
Africa 30065000 7.8E+008 53.00