+
+#if USG | USG3TTY
+/* It's so wonderful how we all speak the same language... */
+# define index strchr
+# define rindex strrchr
+#endif
+
+checkmodeline(line)
+char *line;
+{
+ char *beg, *end;
+ char cmdbuf[1024];
+ char *index(), *rindex();
+
+ beg = index(line, ':');
+ if (beg == NULL)
+ return;
+ if (&beg[-3] < line)
+ return;
+ if (!( ( (beg[-3] == ' ' || beg[-3] == '\t')
+ && beg[-2] == 'e'
+ && beg[-1] == 'x')
+ || ( (beg[-3] == ' ' || beg[-3] == '\t')
+ && beg[-2] == 'v'
+ && beg[-1] == 'i'))) return;
+ strncpy(cmdbuf, beg+1, sizeof cmdbuf);
+ end = rindex(cmdbuf, ':');
+ if (end == NULL)
+ return;
+ *end = 0;
+ globp = cmdbuf;
+ commands(1, 1);
+}