$OpenBSD: patch-view_c,v 1.3 2002/12/21 05:06:31 fgsch Exp $
--- view.c.orig	Sat Oct 12 16:48:22 2002
+++ view.c	Sat Dec 21 01:54:56 2002
@@ -1652,7 +1652,7 @@ void back(struct session *ses, struct f_
 
 void selected_item(struct terminal *term, void *pitem, struct session *ses)
 {
-	int item = (int)pitem;
+	int item = (intptr_t)pitem;
 	int old_item=item;
 	struct f_data_c *f = current_frame(ses);
 	struct link *l;
@@ -2493,7 +2493,7 @@ void send_event(struct session *ses, str
 			goto x;
 		}
 		if ((upcase(ev->x) == 'Q' && !ev->y) || ev->x == KBD_CTRL_C) {
-			exit_prog(ses->term, (void *)(ev->x == KBD_CTRL_C), ses);
+			exit_prog(ses->term, (void *)(intptr_t)(ev->x == KBD_CTRL_C), ses);
 			goto x;
 		}
 		if (ev->x == KBD_CLOSE){
@@ -2598,6 +2598,20 @@ void send_download(struct terminal *term
 		query_file(ses, ses->dn_url, start_download, NULL);
 }
 
+void copy_clipboard(struct terminal *term, void *xxx, struct session *ses)
+{
+#ifdef G
+	struct f_data_c *fd = current_frame(ses);
+	unsigned char *u;
+	if (!fd) return;
+	if (fd->vs->current_link == -1) return;
+	if ((u = get_link_url(ses, fd, &fd->f_data->links[fd->vs->current_link], NULL))) {
+		drv->set_clipboard(u);
+		mem_free(u);
+	}
+#endif
+}
+
 /* open a link in a new xterm */
 void send_open_in_new_xterm(struct terminal *term, void (*open_window)(struct terminal *term, unsigned char *, unsigned char *), struct session *ses)
 {
@@ -2725,6 +2739,7 @@ void link_menu(struct terminal *term, vo
 			if (!F) add_to_menu(&mi, TEXT(T_FOLLOW_LINK), "", TEXT(T_HK_FOLLOW_LINK), MENU_FUNC send_enter, NULL, 0);
 			if (c) add_to_menu(&mi, TEXT(T_OPEN_IN_NEW_WINDOW), c - 1 ? ">" : "", TEXT(T_HK_OPEN_IN_NEW_WINDOW), MENU_FUNC open_in_new_window, send_open_in_new_xterm, c - 1);
 			if (!anonymous) add_to_menu(&mi, TEXT(T_DOWNLOAD_LINK), "d", TEXT(T_HK_DOWNLOAD_LINK), MENU_FUNC send_download, NULL, 0);
+			if (F) add_to_menu(&mi, TEXT(T_COPY_TO_CLIPBOARD), "", TEXT(T_HK_COPY_TO_CLIPBOARD), MENU_FUNC copy_clipboard, NULL, 0);
 			/*add_to_menu(&mi, TEXT(T_ADD_BOOKMARK), "A", TEXT(T_HK_ADD_BOOKMARK), MENU_FUNC menu_bookmark_manager, NULL, 0);*/
 
 		}
