aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/IO/about.c6
-rw-r--r--src/IO/http.c10
-rw-r--r--src/html.cc3
-rw-r--r--src/png.c3
-rw-r--r--src/prefs.c3
-rw-r--r--src/prefs.h1
-rw-r--r--src/prefsparser.cc1
-rw-r--r--src/ui.cc17
-rw-r--r--src/utf8.hh3
9 files changed, 36 insertions, 11 deletions
diff --git a/src/IO/about.c b/src/IO/about.c
index 756b6c69..508bfd11 100644
--- a/src/IO/about.c
+++ b/src/IO/about.c
@@ -240,7 +240,7 @@ const char *const AboutSplash=
"<tr>\n"
" <td bgcolor='#CCCCCC'>\n"
" <h4>Release overview</h4>\n"
-" ??, 2010\n"
+" February 11, 2010\n"
"<tr>\n"
" <td bgcolor='#FFFFFF'>\n"
" <table border='0' cellspacing='0' cellpadding='5'>\n"
@@ -327,8 +327,8 @@ const char *const AboutSplash=
" and the bug meter).\n"
" <li> Dillo behaves very nicely when browsing local files, images, and HTML.\n"
" It's also very good for Internet searching.\n"
-" <li> This release is mainly intended <strong>for developers</strong>\n"
-" and <em>advanced users</em>.\n"
+" <li> This release is mainly intended for <strong>developers</strong>\n"
+" and <strong>advanced users</strong>.\n"
" <li> Frames, Java and Javascript are not supported.\n"
"</ul>\n"
"<br>\n"
diff --git a/src/IO/http.c b/src/IO/http.c
index 8518a392..1ff7399b 100644
--- a/src/IO/http.c
+++ b/src/IO/http.c
@@ -305,6 +305,7 @@ Dstr *a_Http_make_query_str(const DilloUrl *url, bool_t use_proxy)
query,
"POST %s HTTP/1.1\r\n"
"Connection: close\r\n"
+ "Accept: text/*,image/*,*/*;q=0.2\r\n"
"Accept-Charset: utf-8,*;q=0.8\r\n"
"Accept-Encoding: gzip\r\n"
"%s" /* language */
@@ -312,13 +313,13 @@ Dstr *a_Http_make_query_str(const DilloUrl *url, bool_t use_proxy)
"Host: %s\r\n"
"%s"
"%s"
- "User-Agent: Dillo/" VERSION "\r\n"
+ "User-Agent: %s\r\n"
"Content-Length: %ld\r\n"
"Content-Type: %s\r\n"
"%s" /* cookies */
"\r\n",
full_path->str, HTTP_Language_hdr, auth ? auth : "",
- URL_AUTHORITY(url), proxy_auth->str, referer,
+ URL_AUTHORITY(url), proxy_auth->str, referer, prefs.http_user_agent,
(long)URL_DATA(url)->len, content_type->str,
cookies);
dStr_append_l(query, URL_DATA(url)->str, URL_DATA(url)->len);
@@ -329,6 +330,7 @@ Dstr *a_Http_make_query_str(const DilloUrl *url, bool_t use_proxy)
"GET %s HTTP/1.1\r\n"
"%s"
"Connection: close\r\n"
+ "Accept: text/*,image/*,*/*;q=0.2\r\n"
"Accept-Charset: utf-8,*;q=0.8\r\n"
"Accept-Encoding: gzip\r\n"
"%s" /* language */
@@ -336,14 +338,14 @@ Dstr *a_Http_make_query_str(const DilloUrl *url, bool_t use_proxy)
"Host: %s\r\n"
"%s"
"%s"
- "User-Agent: Dillo/" VERSION "\r\n"
+ "User-Agent: %s\r\n"
"%s" /* cookies */
"\r\n",
full_path->str,
(URL_FLAGS(url) & URL_E2EQuery) ?
"Cache-Control: no-cache\r\nPragma: no-cache\r\n" : "",
HTTP_Language_hdr, auth ? auth : "", URL_AUTHORITY(url),
- proxy_auth->str, referer, cookies);
+ proxy_auth->str, referer, prefs.http_user_agent, cookies);
}
dFree(referer);
dFree(cookies);
diff --git a/src/html.cc b/src/html.cc
index cf3e54d8..21cfe2c4 100644
--- a/src/html.cc
+++ b/src/html.cc
@@ -1178,6 +1178,8 @@ static void Html_process_word(DilloHtml *html, const char *word, int size)
if (isspace(word2[i])) {
while (word2[++i] && isspace(word2[i])) ;
Html_process_space(html, word2 + start, i - start);
+ } else if (!strncmp(word2+i, utf8_zero_width_space, 3)) {
+ i += 3;
} else if (a_Utf8_ideographic(word2+i, word2_end, &len)) {
i += len;
HT2TB(html)->addText(word2 + start, i - start,
@@ -1186,6 +1188,7 @@ static void Html_process_word(DilloHtml *html, const char *word, int size)
do {
i += len;
} while (word2[i] && !isspace(word2[i]) &&
+ strncmp(word2+i, utf8_zero_width_space, 3) &&
(!a_Utf8_ideographic(word2+i, word2_end, &len)));
HT2TB(html)->addText(word2 + start, i - start,
html->styleEngine->wordStyle ());
diff --git a/src/png.c b/src/png.c
index 353ebaa3..6a5f4422 100644
--- a/src/png.c
+++ b/src/png.c
@@ -345,8 +345,7 @@ static void Png_write(DilloPng *png, void *Buf, uint_t BufSize)
return; /* need MORE data */
}
/* check the image signature - DON'T update ipbufstart! */
- if (!png_check_sig(png->ipbuf, DATASIZE)) {
- /* you lied to me about it being a PNG image */
+ if (png_sig_cmp(png->ipbuf, 0, DATASIZE)) {
MSG_WARN("\"%s\" is not a PNG file.\n", URL_STR(png->url));
png->state = IS_finished;
break;
diff --git a/src/prefs.c b/src/prefs.c
index d43e33b9..464c496b 100644
--- a/src/prefs.c
+++ b/src/prefs.c
@@ -22,6 +22,7 @@
#define PREFS_NO_PROXY "localhost 127.0.0.1"
#define PREFS_SAVE_DIR "/tmp/"
#define PREFS_HTTP_REFERER "host"
+#define PREFS_HTTP_USER_AGENT "Dillo/" VERSION
/*-----------------------------------------------------------------------------
* Global Data
@@ -61,6 +62,7 @@ void a_Prefs_init(void)
prefs.http_max_conns = 6;
prefs.http_proxyuser = NULL;
prefs.http_referer = dStrdup(PREFS_HTTP_REFERER);
+ prefs.http_user_agent = dStrdup(PREFS_HTTP_USER_AGENT);
prefs.limit_text_width = FALSE;
prefs.load_images=TRUE;
prefs.load_stylesheets=TRUE;
@@ -109,6 +111,7 @@ void a_Prefs_freeall(void)
a_Url_free(prefs.http_proxy);
dFree(prefs.http_proxyuser);
dFree(prefs.http_referer);
+ dFree(prefs.http_user_agent);
dFree(prefs.no_proxy);
dFree(prefs.save_dir);
dFree(prefs.search_url);
diff --git a/src/prefs.h b/src/prefs.h
index d7421f4d..6015f2fe 100644
--- a/src/prefs.h
+++ b/src/prefs.h
@@ -38,6 +38,7 @@ struct _DilloPrefs {
DilloUrl *http_proxy;
char *http_proxyuser;
char *http_referer;
+ char *http_user_agent;
char *no_proxy;
DilloUrl *start_page;
DilloUrl *home;
diff --git a/src/prefsparser.cc b/src/prefsparser.cc
index f2cc50ac..d31c835b 100644
--- a/src/prefsparser.cc
+++ b/src/prefsparser.cc
@@ -67,6 +67,7 @@ int PrefsParser::parseOption(char *name, char *value)
{ "http_proxy", &prefs.http_proxy, PREFS_URL },
{ "http_proxyuser", &prefs.http_proxyuser, PREFS_STRING },
{ "http_referer", &prefs.http_referer, PREFS_STRING },
+ { "http_user_agent", &prefs.http_user_agent, PREFS_STRING },
{ "limit_text_width", &prefs.limit_text_width, PREFS_BOOL },
{ "load_images", &prefs.load_images, PREFS_BOOL },
{ "load_stylesheets", &prefs.load_stylesheets, PREFS_BOOL },
diff --git a/src/ui.cc b/src/ui.cc
index 1561d5ac..fd0639ba 100644
--- a/src/ui.cc
+++ b/src/ui.cc
@@ -850,8 +850,21 @@ int UI::handle(int event)
if (prefs.middle_click_drags_page == 0 &&
event_button() == MiddleButton &&
!a_UIcmd_pointer_on_link(a_UIcmd_get_bw_by_widget(this))) {
- paste_url();
- ret = 1;
+ if (Main->Rectangle::contains (event_x (), event_y ())) {
+ /* Offer the event to Main's children (form widgets) */
+ int save_x = e_x, save_y = e_y;
+
+ e_x -= Main->x();
+ e_y -= Main->y();
+ ret = ((Group *)Main)->Group::handle(event);
+ e_x = save_x;
+ e_y = save_y;
+ }
+ if (!ret) {
+ /* middle click was not on a link or a form widget */
+ paste_url();
+ ret = 1;
+ }
}
}
diff --git a/src/utf8.hh b/src/utf8.hh
index fd1fb87e..4ded50b8 100644
--- a/src/utf8.hh
+++ b/src/utf8.hh
@@ -15,6 +15,9 @@ extern "C" {
*/
static const char utf8_replacement_char[] = "\xEF\xBF\xBD";
+/* Unicode zero width space U+200B */
+static const char utf8_zero_width_space[] = "\xE2\x80\x8B";
+
uint_t a_Utf8_end_of_char(const char *str, uint_t i);
uint_t a_Utf8_decode(const char*, const char* end, int* len);
int a_Utf8_encode(unsigned int ucs, char *buf);