+ }
+
+ /* now check for standard-mode sequences */
+ if (!expansion
+ && (csi = skip_csi(sp)) != 0
+ && (len = strspn(sp + csi, "0123456789;"))
+ && ((sp[csi + len] == 'h') || (sp[csi + len] == 'l'))) {
+ char buf3[MAX_TERMINFO_LENGTH];
+
+ (void) strcpy(buf2, (sp[csi + len] == 'h') ? "ECMA+" : "ECMA-");
+ (void) strncpy(buf3, sp + csi, len);
+ len += csi + 1;
+ buf3[len] = '\0';
+
+ ep = strtok(buf3, ";");
+ do {
+ bool found = FALSE;
+
+ for (ap = std_modes; ap->from; ap++) {
+ size_t tlen = strlen(ap->from);
+
+ if (strncmp(ap->from, ep, tlen) == 0) {
+ (void) strcat(buf2, ap->to);
+ found = TRUE;
+ break;
+ }
+ }
+
+ if (!found)
+ (void) strcat(buf2, ep);
+ (void) strcat(buf2, ";");
+ } while
+ ((ep = strtok((char *) 0, ";")));
+ buf2[strlen(buf2) - 1] = '\0';
+ expansion = buf2;
+ }