StrAllocCopy(temp, "Go "); StrAllocCat(temp, bp); strcpy(buf, temp); FREE(temp); return(bp=buf);
sprintf(buf, "Go %.*s", (int)sizeof(buf) - 4, bp); return (bp = buf);
PUBLIC char *LYJump ARGS1(int, key){    JumpDatum seeking;    JumpDatum *found;    static char buf[124];    char *bp, *cp;    struct JumpTable *jtp;    int ch, recall;    int ShortcutTotal;    int ShortcutNum;    BOOLEAN FirstShortcutRecall = TRUE;    if (!JThead)	return NULL;    jtp = JThead;    while (jtp && jtp->key && jtp->key != key)	jtp = jtp->next;    if (!jtp) {	char *msg = 0;	HTSprintf0(&msg, KEY_NOT_MAPPED_TO_JUMP_FILE, key);	HTAlert(msg);	FREE(msg);	return NULL;    }    if (!jtp->table)	jtp->nel = LYRead_Jumpfile(jtp);    if (jtp->nel == 0)	return NULL;    if (!jump_buffer || !(jtp->shortcut && *jtp->shortcut))	*buf = '\0';    else if (jtp->shortcut && *jtp->shortcut) {	if (strlen(jtp->shortcut) > 119)	    jtp->shortcut[119] = '\0';	strcpy(buf, jtp->shortcut);    }    ShortcutTotal = (jtp->history ? HTList_count(jtp->history) : 0);    if (jump_buffer && *buf) {	recall = ((ShortcutTotal > 1) ? RECALL : NORECALL);	ShortcutNum = 0;	FirstShortcutRecall = FALSE;    } else {	recall = ((ShortcutTotal >= 1) ? RECALL : NORECALL);	ShortcutNum = ShortcutTotal;	FirstShortcutRecall = TRUE;    }    statusline(jtp->msg);    if ((ch=LYgetstr(buf, VISIBLE, (sizeof(buf) - 4), recall)) < 0) {	/*	 * User cancelled the Jump via ^G. - FM	 */	HTInfoMsg(CANCELLED);	return NULL;    }check_recall:    bp = buf;    if (toupper(key) == 'G' && strncmp(buf, "o ", 2) == 0)	bp++;    bp = LYSkipBlanks(bp);    if (*bp == '\0' &&	!(recall && (ch == UPARROW || ch == DNARROW))) {	/*	 * User cancelled the Jump via a zero-length string. - FM	 */	*buf = '\0';	StrAllocCopy(jtp->shortcut, buf);	HTInfoMsg(CANCELLED);	return NULL;    }#ifdef PERMIT_GOTO_FROM_JUMP    if (strchr(bp, ':') || strchr(bp, '/')) {	char *temp=NULL;	LYJumpFileURL = FALSE;	if (no_goto) {	    *buf = '\0';	    StrAllocCopy(jtp->shortcut, buf);	    HTUserMsg(RANDOM_URL_DISALLOWED);	    return NULL;	}	StrAllocCopy(temp, "Go ");	StrAllocCat(temp, bp);	strcpy(buf, temp);	FREE(temp);	return(bp=buf);    }#endif /* PERMIT_GOTO_FROM_JUMP */    if (recall && ch == UPARROW) {	if (FirstShortcutRecall) {	    /*	     * Use last Shortcut in the list. - FM	     */	    FirstShortcutRecall = FALSE;	    ShortcutNum = 0;	} else {	    /*	     * Go back to the previous Shortcut in the list. - FM	     */	    ShortcutNum++;	}	if (ShortcutNum >= ShortcutTotal)	    /*	     * Roll around to the last Shortcut in the list. - FM	     */	    ShortcutNum = 0;	if ((cp=(char *)HTList_objectAt(jtp->history,					ShortcutNum)) != NULL) {	    strcpy(buf, cp);	    if (jump_buffer && jtp->shortcut &&		!strcmp(buf, jtp->shortcut)) {		_statusline(EDIT_CURRENT_SHORTCUT);	    } else if ((jump_buffer && ShortcutTotal == 2) ||		       (!jump_buffer && ShortcutTotal == 1)) {		_statusline(EDIT_THE_PREV_SHORTCUT);	    } else {		_statusline(EDIT_A_PREV_SHORTCUT);	    }	    if ((ch=LYgetstr(buf, VISIBLE,			     sizeof(buf), recall)) < 0) {		/*		 * User cancelled the jump via ^G.		 */		HTInfoMsg(CANCELLED);		return NULL;	    }	    goto check_recall;	}    } else if (recall && ch == DNARROW) {	if (FirstShortcutRecall) {	    /*	     * Use the first Shortcut in the list. - FM	     */	    FirstShortcutRecall = FALSE;	    ShortcutNum = ShortcutTotal - 1;	} else {	    /*	     * Advance to the next Shortcut in the list. - FM	     */	    ShortcutNum--;	}	if (ShortcutNum < 0)	    /*	     * Roll around to the first Shortcut in the list. - FM	     */	    ShortcutNum = ShortcutTotal - 1;	if ((cp=(char *)HTList_objectAt(jtp->history,					ShortcutNum)) != NULL) {	    strcpy(buf, cp);	    if (jump_buffer && jtp->shortcut &&		!strcmp(buf, jtp->shortcut)) {		_statusline(EDIT_CURRENT_SHORTCUT);	    } else if ((jump_buffer && ShortcutTotal == 2) ||		       (!jump_buffer && ShortcutTotal == 1)) {		_statusline(EDIT_THE_PREV_SHORTCUT);	    } else {		_statusline(EDIT_THE_PREV_SHORTCUT);	    }	    if ((ch=LYgetstr(buf, VISIBLE,			     sizeof(buf), recall)) < 0) {		/*		 * User cancelled the jump via ^G.		 */		HTInfoMsg(CANCELLED);		return NULL;	    }	    goto check_recall;	}    }    seeking.key = bp;    found = (JumpDatum *)bsearch((char *)&seeking, (char *)jtp->table,				 jtp->nel, sizeof(JumpDatum), LYCompare);    if (!found) {	user_message("Unknown target '%s'", buf);	sleep(AlertSecs);    }    StrAllocCopy(jtp->shortcut, bp);    LYAddJumpShortcut(jtp->history, jtp->shortcut);    return found ? found->url : NULL;}