+ /*
+ * Strip all but the rightmost UUCP host
+ * to prevent loops due to forwarding.
+ * Start searching leftward from the leftmost '@'.
+ * a!b!c!d yields a short name of c!d
+ * a!b!c!d@e yields a short name of c!d@e
+ * e@a!b!c yields the same short name
+ */
+#ifdef VDEBUG
+printf("start='%s'\n", start);
+#endif
+ *shortp = start; /* assume whole addr */
+ if ((at = index(start, '@')) == NULL) /* leftmost '@' */
+ at = p; /* if none, use end of addr */
+ saveat = *at;
+ *at = '\0';
+ if ((bang = rindex(start, '!')) != NULL) { /* rightmost '!' */
+ char *bang2;
+
+ *bang = '\0';
+ if ((bang2 = rindex(start, '!')) != NULL) /* 2nd rightmost '!' */
+ *shortp = bang2 + 1; /* move past ! */
+ *bang = '!';
+ }
+ *at = saveat;
+#ifdef VDEBUG
+printf("place='%s'\n", *shortp);
+#endif
+