diff -ru links-0.96/default.c links-0.96+user-agent/default.c
--- links-0.96/default.c	Thu Oct 25 23:02:47 2001
+++ links-0.96+user-agent/default.c	Thu Oct 25 22:08:54 2001
@@ -783,6 +783,11 @@
  -version\n\
   Prints the links version number and exit.\n\
 \n\
+ -user-agent <agent>\n\
+  Change the User Agent. That means identification string, which\n\
+  is sent to HTTP server, when a document is requested. Default\n\
+  is \"Links (version; system_id)\".\n\
+\n\
  -help\n\
   Prints this help screen\n\
 \n\
@@ -861,6 +866,8 @@
 
 unsigned char default_anon_pass[MAX_STR_LEN] = "somebody@host.domain";
 
+unsigned char user_agent[MAX_STR_LEN] = "";
+
 /* These are workarounds for some CGI script bugs */
 struct http_bugs http_bugs = { 0, 1, 0, 0 };
 /*int bug_302_redirect = 0;*/
@@ -879,6 +886,7 @@
 	1, version_cmd, NULL, NULL, 0, 0, NULL, NULL, "version",
 	1, no_connect_cmd, NULL, NULL, 0, 0, NULL, NULL, "no-connect",
 	1, anonymous_cmd, NULL, NULL, 0, 0, NULL, NULL, "anonymous",
+	1, gen_cmd, str_rd, str_wr, 0, MAX_STR_LEN, user_agent, "user_agent", "user-agent",
 	1, gen_cmd, num_rd, NULL, 0, MAXINT, &base_session, NULL, "base-session",
 	1, dump_cmd, NULL, NULL, D_DUMP, 0, NULL, NULL, "dump",
 	1, dump_cmd, NULL, NULL, D_SOURCE, 0, NULL, NULL, "source",
diff -ru links-0.96/http.c links-0.96+user-agent/http.c
--- links-0.96/http.c	Thu Oct 25 23:02:47 2001
+++ links-0.96+user-agent/http.c	Thu Oct 25 22:08:54 2001
@@ -238,9 +238,16 @@
 		}
 		add_to_str(&hdr, &l, "\r\n");
 	}
-	add_to_str(&hdr, &l, "User-Agent: Links (" VERSION_STRING "; ");
-	add_to_str(&hdr, &l, system_name);
-	add_to_str(&hdr, &l, ")\r\n");
+        
+	if(!strcmp(user_agent, "")) {
+                add_to_str(&hdr, &l, "User-Agent: Links (" VERSION_STRING "; ");
+                add_to_str(&hdr, &l, system_name);
+                add_to_str(&hdr, &l, ")\r\n");
+        } else {
+                add_to_str(&hdr, &l, "User-Agent: ");
+                add_to_str(&hdr, &l, user_agent);
+                add_to_str(&hdr, &l, "\r\n");
+        }
 
 	switch (referer)
 	{
diff -ru links-0.96/intl/czech.lng links-0.96+user-agent/intl/czech.lng
--- links-0.96/intl/czech.lng	Thu Oct 25 23:02:47 2001
+++ links-0.96+user-agent/intl/czech.lng	Thu Oct 25 22:08:46 2001
@@ -180,6 +180,7 @@
 T_SAVE_IT_OR_DISPLAY_IT, "uložit nebo zobrazit?",
 T_OPEN, "Otevřít",
 T_DO_YOU_WANT_TO_FOLLOW_REDIRECT_AND_POST_FORM_DATA_TO_URL, "Chceš následovat redirekt a poslat data na adresu",
+T_USER_AGENT, "Identifikace browseru",
 T_DO_YOU_WANT_TO_POST_FORM_DATA_TO_URL, "Chceš poslat data z formuláře na adresu",
 T_DO_YOU_WANT_TO_REPOST_FORM_DATA_TO_URL, "Chceš poslat data z formuláře znova na adresu",
 T_WARNING, "Upozornění",
diff -ru links-0.96/intl/english.lng links-0.96+user-agent/intl/english.lng
--- links-0.96/intl/english.lng	Thu Oct 25 23:02:47 2001
+++ links-0.96+user-agent/intl/english.lng	Thu Oct 25 22:08:37 2001
@@ -180,6 +180,7 @@
 T_SAVE_IT_OR_DISPLAY_IT, "save it or display it?",
 T_OPEN, "Open",
 T_DO_YOU_WANT_TO_FOLLOW_REDIRECT_AND_POST_FORM_DATA_TO_URL, "Do you want to follow redirect and post form data to url",
+T_USER_AGENT, "Browser ID",
 T_DO_YOU_WANT_TO_POST_FORM_DATA_TO_URL, "Do you want to post form data to url",
 T_DO_YOU_WANT_TO_REPOST_FORM_DATA_TO_URL, "Do you want to repost form data to url",
 T_WARNING, "Warning",
diff -ru links-0.96/intl/french.lng links-0.96+user-agent/intl/french.lng
--- links-0.96/intl/french.lng	Thu Oct 25 23:02:47 2001
+++ links-0.96+user-agent/intl/french.lng	Thu Oct 25 22:08:46 2001
@@ -180,6 +180,7 @@
 T_SAVE_IT_OR_DISPLAY_IT, "enregistrer ou afficher ?",
 T_OPEN, "Ouvrir",
 T_DO_YOU_WANT_TO_FOLLOW_REDIRECT_AND_POST_FORM_DATA_TO_URL, "Voulez-vous envoyer ces données au nouveau serveur ?",
+T_USER_AGENT, "L'identification du navigateur", 
 T_DO_YOU_WANT_TO_POST_FORM_DATA_TO_URL, "Voulez-vous envoyer ces données ?",
 T_DO_YOU_WANT_TO_REPOST_FORM_DATA_TO_URL, "Vous-vous re-envoyer ces données ?",
 T_WARNING, "Avertissement",
diff -ru links-0.96/links.1 links-0.96+user-agent/links.1
--- links-0.96/links.1	Thu Oct 25 23:02:47 2001
+++ links-0.96+user-agent/links.1	Thu Oct 25 22:08:54 2001
@@ -161,6 +161,12 @@
 (default: 600)
 
 .TP
+\f3-user-agent\f1
+Change the User Agent. That means identification string, which
+is sent to HTTP server, when a document is requested. Default
+is "Links (version; system_id)".
+
+.TP
 \f3-version\f1
 Print the 
 .I links
diff -ru links-0.96/links.h links-0.96+user-agent/links.h
--- links-0.96/links.h	Thu Oct 25 23:02:47 2001
+++ links-0.96+user-agent/links.h	Thu Oct 25 22:08:54 2001
@@ -1968,6 +1968,7 @@
 int save_url_history();
 
 extern int anonymous;
+extern unsigned char user_agent[];
 
 extern unsigned char system_name[];
 
diff -ru links-0.96/menu.c links-0.96+user-agent/menu.c
--- links-0.96/menu.c	Thu Oct 25 23:02:47 2001
+++ links-0.96+user-agent/menu.c	Thu Oct 25 23:00:56 2001
@@ -454,7 +454,7 @@
  	do_dialog(term, d, getml(d, NULL));
 }
 
-unsigned char *http_labels[] = { TEXT(T_USE_HTTP_10), TEXT(T_ALLOW_SERVER_BLACKLIST), TEXT(T_BROKEN_302_REDIRECT), TEXT(T_NO_KEEPALIVE_AFTER_POST_REQUEST), TEXT(T_REFERER_NONE), TEXT(T_REFERER_TRUE), TEXT(T_REFERER_SAME_URL), TEXT(T_REFERER_FAKE), TEXT(T_FAKE_REFERER) };
+unsigned char *http_labels[] = { TEXT(T_USE_HTTP_10), TEXT(T_ALLOW_SERVER_BLACKLIST), TEXT(T_BROKEN_302_REDIRECT), TEXT(T_NO_KEEPALIVE_AFTER_POST_REQUEST), TEXT(T_REFERER_NONE), TEXT(T_REFERER_TRUE), TEXT(T_REFERER_SAME_URL), TEXT(T_REFERER_FAKE), TEXT(T_FAKE_REFERER), TEXT(T_USER_AGENT), };
 
 void httpopt_fn(struct dialog_data *dlg)
 {
@@ -474,10 +474,12 @@
 	if (w > term->x - 2 * DIALOG_LB) w = term->x - 2 * DIALOG_LB;
 	if (w < 5) w = 5;
 	rw = 0;
-	dlg_format_checkboxes(NULL, term, dlg->items, dlg->n - 3, 0, &y, w, &rw, dlg->dlg->udata);
+	dlg_format_checkboxes(NULL, term, dlg->items, dlg->n - 4, 0, &y, w, &rw, dlg->dlg->udata);
 	y++;
 	dlg_format_text(NULL, term, http_labels[8], 0, &y, w, &rw, COLOR_DIALOG_TEXT, AL_LEFT);
 	y+=2;
+	dlg_format_text(NULL, term, http_labels[9], 0, &y, w, &rw, COLOR_DIALOG_TEXT, AL_LEFT);
+	y+=2;
 	dlg_format_buttons(NULL, term, dlg->items + dlg->n - 2, 2, 0, &y, w, &rw, AL_CENTER);
 	w = rw;
 	dlg->xw = rw + 2 * DIALOG_LB;
@@ -485,11 +487,14 @@
 	center_dlg(dlg);
 	draw_dlg(dlg);
 	y = dlg->y + DIALOG_TB + 1;
-	dlg_format_checkboxes(term, term, dlg->items, dlg->n - 3, dlg->x + DIALOG_LB, &y, w, NULL, dlg->dlg->udata);
+	dlg_format_checkboxes(term, term, dlg->items, dlg->n - 4, dlg->x + DIALOG_LB, &y, w, NULL, dlg->dlg->udata);
 	y++;
 	dlg_format_text(term, term, http_labels[8], dlg->x + DIALOG_LB, &y, w, NULL, COLOR_DIALOG_TEXT, AL_LEFT);
 	dlg_format_field(term, term, dlg->items + 8, dlg->x + DIALOG_LB, &y, w, NULL, AL_LEFT);
 	y++;
+	dlg_format_text(term, term, http_labels[9], dlg->x + DIALOG_LB, &y, w, NULL, COLOR_DIALOG_TEXT, AL_LEFT);
+	dlg_format_field(term, term, dlg->items + 9, dlg->x + DIALOG_LB, &y, w, NULL, AL_LEFT);
+	y++;
 	dlg_format_buttons(term, term, dlg->items + dlg->n - 2, 2, dlg->x + DIALOG_LB, &y, w, &rw, AL_CENTER);
 }
 
@@ -498,8 +503,8 @@
 {
 	struct http_bugs *bugs = (struct http_bugs *)di->cdata;
 	struct dialog *d;
-	if (!(d = mem_alloc(sizeof(struct dialog) + 12 * sizeof(struct dialog_item)))) return 0;
-	memset(d, 0, sizeof(struct dialog) + 12 * sizeof(struct dialog_item));
+	if (!(d = mem_alloc(sizeof(struct dialog) + 13 * sizeof(struct dialog_item)))) return 0;
+	memset(d, 0, sizeof(struct dialog) + 13 * sizeof(struct dialog_item));
 	d->title = TEXT(T_HTTP_BUG_WORKAROUNDS);
 	d->fn = httpopt_fn;
 	d->udata = http_labels;
@@ -542,15 +547,18 @@
 	d->items[8].type = D_FIELD;
 	d->items[8].dlen = MAX_STR_LEN;
 	d->items[8].data = fake_referer;
-	d->items[9].type = D_BUTTON;
-	d->items[9].gid = B_ENTER;
-	d->items[9].fn = ok_dialog;
-	d->items[9].text = TEXT(T_OK);
+	d->items[9].type = D_FIELD;
+	d->items[9].dlen = MAX_STR_LEN;
+	d->items[9].data = user_agent;
 	d->items[10].type = D_BUTTON;
-	d->items[10].gid = B_ESC;
-	d->items[10].fn = cancel_dialog;
-	d->items[10].text = TEXT(T_CANCEL);
-	d->items[11].type = D_END;
+	d->items[10].gid = B_ENTER;
+	d->items[10].fn = ok_dialog;
+	d->items[10].text = TEXT(T_OK);
+	d->items[11].type = D_BUTTON;
+	d->items[11].gid = B_ESC;
+	d->items[11].fn = cancel_dialog;
+	d->items[11].text = TEXT(T_CANCEL);
+	d->items[12].type = D_END;
  	do_dialog(dlg->win->term, d, getml(d, NULL));
 	return 0;
 }
