1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-10-01 03:36:26 -04:00
Commit Graph

2274 Commits

Author SHA1 Message Date
Kalle Olavi Niemitalo
4138b401ca Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:

	src/document/css/stylesheet.c
	src/document/css/stylesheet.h
2008-01-26 18:15:33 +02:00
Kalle Olavi Niemitalo
a831beb6c8 const in BitTorrent 2008-01-26 18:10:35 +02:00
Kalle Olavi Niemitalo
cab0b3fbd5 const in CSS 2008-01-26 18:10:13 +02:00
Kalle Olavi Niemitalo
0689443ad2 const in map_scanner_string 2008-01-26 17:57:14 +02:00
Kalle Olavi Niemitalo
f02e471762 const in decode_color 2008-01-26 17:53:14 +02:00
Kalle Olavi Niemitalo
3f508a9803 const in fastfind_search 2008-01-26 17:52:22 +02:00
Kalle Olavi Niemitalo
721af4e749 Detect all overflows in BitTorrent parse_bencoding_integer.
The previous check (integer > (off_t) integer * 10) did not detect all
overflows.  Examples with 32-bit off_t:

integer = 0x1C71C71D (0x100000000/9 rounded up);
integer * 10 = 0x11C71C722, wraps to 0x1C71C722 which is > integer.

integer = 0x73333333;
integer * 10 = 0x47FFFFFFE, wraps to 0x7FFFFFFE which is > integer.

Examples with 64-bit off_t:

integer = 0x1C71C71C71C71C72 (0x10000000000000000/9 rounded up);
integer * 10 = 0x11C71C71C71C71C74, wraps to 0x1C71C71C71C71C74
which is > integer.

integer = 0x7333333333333333;
integer * 10 = 0x47FFFFFFFFFFFFFFE, wraps to 0x7FFFFFFFFFFFFFFE
which is > integer.

It is unclear to me what effect an undetected overflow would actually
have from the user's viewpoint, so I'm not adding a NEWS entry.
(cherry picked from commit a25fd18e56)
2008-01-26 16:47:51 +02:00
Kalle Olavi Niemitalo
9699a03e74 Don't assume sizeof(int)==4 in bittorrent
(cherry picked from commit f3bad399e2)
2008-01-26 16:47:47 +02:00
Miciah Dashiel Butler Masters
cade70e745 Fix -dump with multicell characters
(cherry picked from commit e0f0112de9)
2008-01-25 09:57:48 +02:00
Kalle Olavi Niemitalo
228595ff29 Bug 824: TERMOPT_WIDGETS_COUNT was off by one.
Commit f19c948ca7 on 2008-01-19
introduced this sub-bug.
2008-01-25 00:06:15 +02:00
Kalle Olavi Niemitalo
40f319ce22 Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:

	po/pl.po
2008-01-22 01:09:18 +02:00
Kalle Olavi Niemitalo
e5922e4fe1 Bug 997: Fix unlikely stack corruption in get_pasv_socket.
It is unlikely because the standard members of struct sockaddr_in
(sin_family, sin_port, sin_addr) already require at least 8 bytes
and I don't know of any system that has size_t larger than that.
Besides, at least glibc pads the structure to 16 bytes.
2008-01-22 00:42:13 +02:00
Kalle Olavi Niemitalo
0c1b52637f get_pasv_socket: Use AF_INET6 when appropriate.
When get_pasv6_socket was merged into get_pasv_socket on 2005-04-15,
the AF_INET6 of get_pasv6_socket was lost and the merged function
always returned AF_INET sockets.  This then made getsockname fill
only part of the struct sockaddr_in6, and ELinks sent to the server
an EPRT command that had half the bits missing from the IPv6 address.
At least ftp.funet.fi then rejected the command, helpfully saying
what the address should have been.

This commit fixes active FTP over IPv6.  Passive FTP was already fixed
in 0.11.3.GIT (887d650efe), on 2007-05-01.
2008-01-22 00:41:25 +02:00
Kalle Olavi Niemitalo
f19c948ca7 Bug 824: Disable combining characters unless --enable-combining.
Label this as an experimental feature because it has so many bugs
and it is not clear how they can be fixed.
2008-01-19 20:58:22 +02:00
Kalle Olavi Niemitalo
14d1a0f3e2 Bug 824: Define _XOPEN_SOURCE, not __USE_XOPEN.
_XOPEN_SOURCE has been standardized in SUSv2.  <features.h> of GNU
libc then defines the internal __USE_XOPEN macro.
2008-01-19 20:52:05 +02:00
Kalle Olavi Niemitalo
2fd3e0b3b3 combined: Leave the screen_char attributes unchanged.
The previous code displayed the wrong attributes if the combining
characters were at the end of an HTML link.  For example:

  <a href="#">trickỹ</a> more text <a href="#">second link</a>

  (The characters in the first A element are "tricky" and U+0303
  COMBINING TILDE.)

Here, when the cursor was not at the first link, ELinks displayed
the y-with-tilde cell as if it were not part of the link.
This happened because ELinks had already changed schar->attr
before set_line saw the space character after the link and
flushed document->combi[].
2008-01-19 20:50:10 +02:00
Witold Filipczyk
83a4d815ae combined: Added combining characters support.
Combining characters requires a UTF-8 locale.
It slows down rendering. There is still the unresolved issue with
combining characters at the end of a document.
This patch wasn't heavilly tested. Especially a "garbage" input may cause
unpredictable results.
2008-01-19 20:49:57 +02:00
Witold Filipczyk
560818568a combined: Added the option "combine" to terminal and screen driver options.
Note that, combining characters work only on XTerm with UTF-8 locale setings.
2008-01-19 20:49:47 +02:00
Kalle Olavi Niemitalo
64102db7ae Bug 867: Don't consume KBD_MOD_PASTE to enter insert mode.
In the previous version, the first event that had KBD_MOD_PASTE
entered insert mode and was consumed for that; ELinks then inserted
the characters from the remaining events.  Now, to make ELinks insert
the first character too, I'm changing things so that KBD_MOD_PASTE
does not cause insert mode to be entered; instead, ELinks inserts
those characters regardless of whether insert mode is on.
2008-01-19 18:12:57 +02:00
Kalle Olavi Niemitalo
d79edd5954 Bug 867: More comments. 2008-01-19 18:12:18 +02:00
Witold Filipczyk
213b1933b3 fsp: Drop the protocol.fsp.sort, always sort entries.
The fsp_opendir always read the whole directory.
Sorting entries do not slow down noticeably.
2008-01-19 17:09:09 +02:00
Kalle Olavi Niemitalo
4c390589ea Bug 939: Documented the fix.
The fix itself is in the parent commit.
2008-01-19 10:55:11 +02:00
Witold Filipczyk
06bcc48487 fsp: Fixed a serious bug.
*fresult pointed to nowhere. On FreeBSD *fresult == NULL
and directories weren't displayed.
Check also if safe_write writes all data.
2008-01-18 21:15:28 +01:00
Kalle Olavi Niemitalo
a5bb4f1011 Bug 867: Request and recognize bracketed paste.
This is based on attachment 389 from bugzilla.elinks.cz
but there were a number of conflicts already.
2008-01-14 23:53:56 +02:00
Kalle Olavi Niemitalo
87f1661314 Bug 54: Don't force 8-bit characters and no parity.
Actually, don't use the cfmakeraw function at all,
and don't look for it during configure either.
2008-01-13 19:26:00 +02:00
Kalle Olavi Niemitalo
04b1e78039 Bug 722: Comment about case-sensitivity of media type names. 2008-01-12 10:08:57 +02:00
Kalle Olavi Niemitalo
d2733656b8 Bug 722: Truncate names of HTML media types.
HTML 4.01 section 6.13 says each entry in the list
must be truncated before the first character that
is not in the allowed set.
2008-01-12 10:08:02 +02:00
Kalle Olavi Niemitalo
65b365587e Bug 722: Read document.css.media only if needed. 2008-01-12 09:37:56 +02:00
Kalle Olavi Niemitalo
0c899dcc8a Bug 722: Default to media="all", not media="screen". 2008-01-12 09:35:41 +02:00
Miciah Dashiel Butler Masters
bbd4464f88 update_status: Do not set the dirty flag just for toggling the LED panel
Do not redraw the document when toggling whether the LED panel is
displayed.
2008-01-03 06:41:15 +00:00
Miciah Dashiel Butler Masters
0d001a88b7 redraw_leds: Redraw the LED panel for each terminal, not each session
Since there is only one LED panel per terminal, redrawing for each session
is wasteful.

Furthermore, since one terminal can have many sessions (i.e. tabs), and
since the last session in the list might not be the current session, the
wrong LEDs might be drawn.

An easy way to demonstrate the bug is to enable ui.clock.enable, so that
the panel is redrawn every 100ms, and then to select a text field and enter
insert mode.  Unless the current tab is the last tab, the insert-mode LED
will only briefly show that insert mode is enabled.
2008-01-03 06:38:27 +00:00
Miciah Dashiel Butler Masters
12dce0d1c0 setup_session: Restore ses->doc_view->vs pointer after copying base's vs
After copying the base session's viewstate, restore the ses->doc_view->vs
pointer.

This follows up on commit 65321923b9:

    In setup_session, copy the viewstate for the new session from the base
    session.

This fixes bug 977:  When opening a javascript: link in a new tab, an
assertion on ses->doc_view->vs in ecmascript_protocol_handler would fail.
2007-12-27 21:36:46 +00:00
Miciah Dashiel Butler Masters
f598226be4 Don't copy current tab when using -remote
In init_remote_session, pass open_uri_in_new_tab a false argument for the based parameter so that the new tab does not get the old tabs current location in its history.
2007-12-23 13:56:34 +00:00
Miciah Dashiel Butler Masters
eb2db32f1e css_hook_css: Fix document.css.media change hook
When document.css.media is changed, make sure to call draw_formatted with rerender = 2 to force a more complete rerendering.
2007-12-22 03:59:34 +00:00
Miciah Dashiel Butler Masters
670d13728a Optionally honour "display: none" (default off)
Because ELinks's CSS support is still so incomplete, some documents still render better if "display: none" is not honoured.  Therefore, it is now honoured, unless document.css.ignore_display_none = 0, which is the default.
2007-12-22 03:59:22 +00:00
Miciah Dashiel Butler Masters
3ee39dae2b css_parse_atrule: Drop an unnecessary check
We have a while loop that checks token && token->type != '}' followed by an if statement that checks token && token->type == }.  If the while loop exits, that either token is false or token->type == '}'; therefore, the if statement need only check token.
2007-12-22 03:25:10 +00:00
Kalle Olavi Niemitalo
60144e9ff6 Bug 722: Filter CSS according to media types.
This patch adds support for:
- option document.css.media
- CSS @import "foo.css" tty;
- CSS @media tty { ... }
- HTML <link rel="stylesheet" media="tty">
- HTML <style media="tty">

This patch is attachments 395 and 396 from bugzilla.elinks.cz, which
are based on attachment 388 from bugzilla.elinks.cz.  This new
version of the patch fixes conflicts with recent 0.13.GIT changes,
marks Doxygen commands with at-signs rather than backslashes, and
adds a few comments.
2007-12-22 03:18:06 +00:00
Miciah Dashiel Butler Masters
ae88223664 Make sure to always check or assert the result of get_opt_rec
Most callers already check.  Add checks to commit_option_values, checkout_option_values, and get_content_type_default.
2007-12-21 22:49:38 +00:00
Kalle Olavi Niemitalo
9fff802c08 Merge branch 'elinks-0.12' into elinks-0.13 2007-12-16 10:12:08 +02:00
Kalle Olavi Niemitalo
a307371d9e Comments about arithmetic in scrolling.
(cherry picked from commit 4871ad0643)
2007-12-16 01:14:08 +02:00
Witold Filipczyk
04387d8d6c Added function move_cursor_rel_count and used it
in move-link-left-line and others, so move-link-left-line ans others
do not use the keyboard prefix.
(cherry picked from commit 8b281e1404)
(cherry picked from commit 4f2a9eadfc)
2007-12-16 01:14:02 +02:00
Witold Filipczyk
f33b7dea02 Removed not existent function. Spotted by Kalle.
(cherry picked from commit a76ecfb8ca)
(cherry picked from commit 54cf868429)
2007-12-16 01:13:53 +02:00
Witold Filipczyk
617e33187d move-link-up-line and others: changed mode to NAVIGATE_CURSOR_ROUTING when
there is no link.
(cherry picked from commit 7db2f8c629)
(cherry picked from commit f62eca8d92)
2007-12-16 01:13:46 +02:00
Witold Filipczyk
61eb46e94d New action: move-cursor-line-start.
It moves cursor to the start of the line.
(cherry picked from commit 5ee1d3b2b3)
(cherry picked from commit 3a87ec55fc)
2007-12-16 01:13:39 +02:00
Witold Filipczyk
d358810a5f move-link-prev(next)-line: Typo with cut-n-paste. s/line/last/.
(cherry picked from commit 848852b75f)
(cherry picked from commit 64c385f0db)
2007-12-16 01:13:32 +02:00
Witold Filipczyk
d1d8c0632a move-link-up-line: segfault when cursor was below last line.
(cherry picked from commit c646c860cd)
(cherry picked from commit 9561d8d0fd)
2007-12-16 01:13:25 +02:00
Witold Filipczyk
175f355320 move-link-prev-line: Really fixed.
(cherry picked from commit 052f7a93bb)
(cherry picked from commit 1a9112945b)
2007-12-16 01:13:18 +02:00
Witold Filipczyk
885adc7a57 move-link-prev-line .. move-link-down-line: Fixed.
(cherry picked from commit bb0166279f)
(cherry picked from commit 27361d141a)
2007-12-16 01:13:12 +02:00
Witold Filipczyk
f2de26b2d5 Fixed the issue with multiline links.
(cherry picked from commit 3555f68059)
(cherry picked from commit 8863f4335f)
2007-12-16 01:13:04 +02:00
Witold Filipczyk
a282a98d4a Avoid segfault.
Go to the page with a few lines. Follow a link to a page with more lines.
Move cursor down, do not stay on a link.
Go back and do move-link-prev-line. This caused a segmentation fault.
(cherry picked from commit 888ba87516)
(cherry picked from commit 1cbd02c141)
2007-12-16 01:12:57 +02:00