+ if (strlen (s1) <= x1)
+ return NULL;
+
+ /* The non-digit parts of s0 and s1 must be identical. */
+ if (0 != strncmp (s0, s1, x0))
+ return NULL;
+
+ /* Both names must end with digits. */
+ int len_s0_pfx = strspn (s0 + x0, "0123456789");
+ if (len_s0_pfx + x0 != strlen (s0))
+ return NULL;
+
+ int len_s1_pfx = strspn (s1 + x1, "0123456789");
+ if (len_s1_pfx + x1 != strlen (s1))
+ return NULL;
+
+ const char *n_start = s0 + x0;
+ const char *n_stop = s1 + x1;
+
+ /* The first may not be greater than the last. */
+ if (atoi (n_start) > atoi (n_stop))
+ return NULL;
+
+ char *prefix = xstrndup (s0, x1);
+
+ *first = atoi (n_start);
+ *last = atoi (n_stop);
+
+ return prefix;
+}
+
+
+/* Parses and performs the RENAME subcommand of GET, SAVE, and
+ related commands. If RELAX is true, then the new variable
+ names need not conform to the normal dictionary rules.
+*/
+bool
+parse_dict_rename (struct lexer *lexer, struct dictionary *dict,
+ bool relax)
+{
+ struct variable **oldvars = NULL;
+ size_t n_newvars = 0;
+ int group = 0;
+ char **newnames = NULL;