--- /dev/null
+diff -urp elinks-0.10.0/src/viewer/text/search.c elinks-0.10.0a/src/viewer/text/search.c
+--- elinks-0.10.0/src/viewer/text/search.c 2004-12-17 17:19:08.000000000 +0100
++++ elinks-0.10.0a/src/viewer/text/search.c 2011-06-06 00:42:15.000000000 +0200
+@@ -1107,7 +1107,7 @@ search_link_text(struct document *docume
+ int match_offset = match_link_text(link, text, textlen,
+ case_sensitive);
+
+- if (match_offset >= 0) {
++ if (match_offset == 0) {
+ *offset = match_offset;
+ return i;
+ }
--- /dev/null
+diff -urp elinks-0.12pre5.orig/src/terminal/kbd.c elinks-0.12pre5/src/terminal/kbd.c
+--- elinks-0.12pre5.orig/src/terminal/kbd.c 2009-07-07 14:23:17.000000000 +0200
++++ elinks-0.12pre5/src/terminal/kbd.c 2011-06-06 02:29:58.000000000 +0200
+@@ -765,6 +765,11 @@ decode_terminal_escape_sequence(struct i
+ int v;
+ int el;
+
++ if (itrm->in.queue.len == 2 && itrm->in.queue.data[1] == ASCII_ESC) {
++ kbd.key = KBD_ESC;
++ set_kbd_interlink_event(ev, kbd.key, kbd.modifier);
++ return 2;
++ }
+ if (itrm->in.queue.len < 3) return -1;
+
+ if (itrm->in.queue.data[2] == '[') {
+@@ -1108,8 +1113,7 @@ process_queue(struct itrm *itrm)
+ * beginning of e.g. ESC ESC 0x5B 0x41,
+ * which we should parse as Esc Up. */
+ if (itrm->in.queue.len < 3) {
+- /* Need more data to figure it out. */
+- el = -1;
++ el = decode_terminal_escape_sequence(itrm, &ev);
+ } else if (itrm->in.queue.data[2] == 0x5B
+ || itrm->in.queue.data[2] == 0x4F) {
+ /* The first ESC appears to be followed
%bcond_without lua # Disable Lua scripting
%bcond_without openssl # Disable OpenSSL support
%bcond_without perl # Disable Perl scripting
+%bcond_with olderisbetter # variuos pre-0.10.0 behaviour rules (typeahead and esc-esc)
%if %{with gnutls}
%undefine with_openssl
Patch0: %{name}-home_etc.patch
Patch1: %{name}-lua40.patch
Patch2: %{name}-date-format.patch
-Patch3: %{name}-old_incremental.patch
-Patch4: %{name}-fbterm.patch
+Patch3: %{name}-fbterm.patch
+Patch4: %{name}-old_incremental.patch
+Patch5: %{name}-0.10.0-0.9.3-typeahead-beginning.patch
+Patch6: %{name}-double-esc.patch
URL: http://www.elinks.cz/
BuildRequires: autoconf >= 2.61
BuildRequires: automake
BuildRequires: bzip2-devel
BuildRequires: expat-devel
%{?with_fsp:BuildRequires: fsplib-devel}
+#BuildRequires: gc-devel
BuildRequires: gettext-devel
%{?with_gnutls:BuildRequires: gnutls-devel >= 1.2.5}
BuildRequires: gpm-devel
%{?with_guile:BuildRequires: guile-devel}
+#BuildRequires: heimdal-devel
%{?with_js:BuildRequires: js-devel >= 1.5-0.rc6a.1}
%{?with_idn:BuildRequires: libidn-devel}
%{?with_smb:BuildRequires: libsmbclient-devel}
%patch0 -p1
%patch1 -p1
%patch2 -p1
-# restores old behaviour of type-ahead search
-#%patch3 -p1
+%patch3 -p1
+%if %{with olderisbetter}
%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%endif
%build
%{__aclocal}
--enable-finger \
--enable-gopher \
--enable-nntp \
+ --enable-88-colors \
%{?with_256:--enable-256-colors} \
+ --enable-true-color \
--enable-exmode \
%{?with_fsp:--enable-fsp} \
%{?with_leds:--enable-leds} \