+ a2 = rindex(buf, ' '); /* before state & zip */
+ if (a2 && isupper(a2[1]) && isupper(a2[2]) &&
+ isdigit(a2[3]) && isdigit(a2[4]) && isdigit(a2[5]) &&
+ isdigit(a2[6]) && isdigit(a2[7])) {
+ /* Must be postal address. */
+ /* missing space between state & zip, fix */
+ for (p = a2; *p; p++); /* find end of string */
+ for (p--; isdigit(*p); p--)
+ p[2] = p[1];
+ p[2] = p[1];
+ p[1] = ' ';
+ /* Backup to previous space, start of state */
+ for (; *a2 != ' '; a2--);
+ /* Backup to previous space, start of city */
+ for (a2--; *a2 != ' '; a2--);
+ /* terminate first line, leave a2 pointing at second */
+ *a2++ = 0;
+ } else {
+ /* Must be interdepartmental */
+ a2 = "MIT INTERDEPARTMENTAL MAIL";
+ }