1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-19 01:36:33 -04:00
Commit Graph

2844 Commits

Author SHA1 Message Date
Miciah Dashiel Butler Masters
a3ad625122 Add newlines to some function signatures to comply with style standards
Make the signatures for lock_globhist_item, unlock_globhist_item,
is_globhist_item_used, and select_read comply with ELinks C style
guidelines.
2008-07-08 07:06:31 +00:00
Kalle Olavi Niemitalo
314a41588c Bug 951: weaken pointer from JSObject to cache_entry
The SpiderMonkey scripting module handles the "pre-format-html" event
by constructing a JSObject for the struct cache_entry and then calling
elinks.preformat_html(cache_entry, view_state) if such a function
exists.  The problem with this was that each such JSObject kept the
struct cache_entry locked until SpiderMonkey garbage-collected the
JSObject, even if the user had not defined an elinks.preformat_html
function and the JSObject was thus never needed at all.  To work
around that, the SpiderMonkey scripting module ran a garbage
collection whenever the user told ELinks to flush caches.

Remove the SpiderMonkey scripting module's use of object_lock and
object_unlock on struct cache_entry, and instead make the pointers
weak so that ELinks can free the cache_entry whenever it wants even if
a JSObject is pointing to it.  Each cache_entry now has a pointer back
to the JSObject; done_cache_entry calls smjs_detach_cache_entry_object,
which follows the pointer and detaches the cache_entry and the JSObject
from each other.

This commit does not yet remove the workaround mentioned above.
2008-07-07 23:24:43 +03:00
Kalle Olavi Niemitalo
5c0128d82d Bug 1021: initialize version in http_got_header
gcc-4.3 -O2 was complaining that http_got_header may use uninitialized
version.major and version.minor.  That indeed happened with HTTP/0.9
servers, and the PRE_HTTP_1_1(version) check then had an undefined
result, so http->close could remain 0 even though it should have
become 1; fortunately, it was then set to 1 anyway, because there was
no Content-Length header.  The undefined version was also saved in
http->recv_version, but it appears nothing ever reads that.  So in the
end, the bug did not cause any symptoms at runtime, but the warning
broke the build on gcc-4.3 if ELinks was configured with --enable-debug.
2008-07-04 16:42:35 +03:00
Miciah Dashiel Butler Masters
5733f17856 goto_current_link: do nothing on input buttons
The following is in the HTML 4 standard
(<http://www.w3.org/TR/html401/interact/forms.html#push-button>):

    push buttons: Push buttons have no default behavior. Each push
    button may have client-side scripts associated with the element's
    event attributes. When an event occurs (e.g., the user presses the
    button, releases it, etc.), the associated script is triggered.

Currently, a button such created by such HTML as "<input type="button"
value="foo" />" submits the form by default in ELinks.  According to
the above, it shouldn't.
2008-07-03 13:48:08 +03:00
Witold Filipczyk
429e08e073 bug 955: Do not call onsubmit for RESET. 2008-07-03 13:48:07 +03:00
Jonas Fonseca
26e8e52f23 Fix sgml-parser so it compiles
The test does however segfault in the incremental parsing test.
2008-07-03 01:45:45 +02:00
Miciah Dashiel Butler Masters
6cf099a087 Bug 983: Give precedence to HTTP Content-Type header over HTML meta tag
The Content-Type from the HTTP response header has
precedence over the Content-Type from a meta http-equiv tag.
http://www.w3.org/International/tutorials/tutorial-char-enc/en/all.html

This fixes bug 983.
2008-06-30 19:29:02 +00:00
Jonas Fonseca
1bd98053b0 Fix memory leak in the DOM configuration module
... by making the (only) user (which is the RSS renderer) responsible
allocation of the dom_config structure.
2008-06-21 00:19:15 +02:00
Miciah Dashiel Butler Masters
c21a3592c9 Build fix: Wrap supports_html_media_attr with #ifdef CONFIG_CSS/#endif 2008-06-18 08:48:18 +00:00
Kalle Olavi Niemitalo
ed17eb18df Bug 1016: Avoid JSFunctionSpec.
(cherry picked from commit 6bfaa7ca8d)

Conflicts:

	src/ecmascript/spidermonkey/form.c
	src/scripting/smjs/elinks_object.c
2008-06-17 00:25:59 +03:00
Miciah Dashiel Butler Masters
0b99fa70ca Bug 620: Reset form fields to default values on reload
Do not retain changed values in form fields when the user reloads.  Doing
so can be confusing or even cause data-loss when new default values are
specified in the updated document.  For example, when editing an article on
Wikipedia, one loads the edit page for the article, makes and submits
changes, goes back to the edit page to make further modifications, and
reloads to get the new article text.  Before this change, reloading the
edit page would not update the textarea on the page with the new article
source, which can lead one (and has led me) to make changes to the original
version of the article by accident.

This fixes bug 620.
(cherry picked from commit 9e1e94bee0)
2008-06-15 22:49:57 +03:00
Kalle Olavi Niemitalo
5b6c913c6a Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:

	src/network/connection.h
	src/session/download.c
	src/session/download.h
2008-06-15 21:43:08 +03:00
Kalle Olavi Niemitalo
69cae5d791 Revert "Gradual rendering in pager mode. ELinks is almost as good as less."
I am reverting all /dev/fd recognition because of bug 917.
This reverts commit c283f8cfd9,
except src/protocol/file/file.c still needs #include "osdep/osdep.h"
for STRING_DIR_SEP.
2008-06-15 19:31:29 +03:00
Kalle Olavi Niemitalo
006b68716b Revert "set_nonblocking_fd seems to be superfluous"
I am reverting all /dev/fd recognition because of bug 917.
This reverts commit 9c3817675f.
2008-06-15 19:24:53 +03:00
Kalle Olavi Niemitalo
fcb3ba5ba4 Revert "Some day in the future ELinks will handle copiousoutput without external"
I am reverting all copiousoutput support because of bug 917.
This reverts commit 8ebcddeff4.
2008-06-15 14:39:02 +03:00
Kalle Olavi Niemitalo
eb8bbc9286 Revert "Copiousoutput part II. To be continued ..."
I am reverting all copiousoutput support because of bug 917.
This reverts commit f6115e65ec.

Conflicts:

	src/session/download.h: type_query.cgi, and Doxygen comments.
2008-06-15 14:38:48 +03:00
Kalle Olavi Niemitalo
196c3a8134 Revert "int_min instead of int_max. Valgrind said: invalid read"
I am reverting all copiousoutput support because of bug 917.
This reverts commit a2c12d7653.

Conflicts:

	src/session/download.c: The int_min vs. int_max change had
	  already been obsoleted by using safe_strncpy instead,
	  in commit efcd6c9758 for bug 896 on 2007-07-24.
	  Also, TERM_EXEC_FG and TERM_EXEC_BG had been added.
2008-06-15 14:31:17 +03:00
Kalle Olavi Niemitalo
6e0d4cf4bf Revert "Copiousoutput final stage. I doubt that /dev/fd/%d is portable. It works"
I am reverting all copiousoutput support because of bug 917.
This reverts commit 6ead4e9c65.

Conflicts:

	src/session/download.c: TERM_EXEC_FG and TERM_EXEC_BG had been
	  added after the original commit.
2008-06-15 14:21:55 +03:00
Kalle Olavi Niemitalo
bfb034c953 Revert "copiousoutput: cleanup after copiousoutput handling. Temporary files should"
I am reverting all copiousoutput support because of bug 917.
This reverts commit 4dc4ea47f2.

Conflicts:

	src/network/connection.h: After the original commit, the declaration
	  of copiousoutput_data had been changed to use the LIST_OF macro.
	  Also, connection.cgi had been added next to the connection.popen
	  member added by the original commit.
	src/session/download.c: After the original commit, the definition of
	  copiousoutput_data had been changed to use the INIT_LIST_OF macro.
2008-06-15 14:17:44 +03:00
Kalle Olavi Niemitalo
5ef6c9e395 Revert "copiousoutput: only mark /dev/fd/%d as popen data . I reflect if ELinks may"
I am reverting all copiousoutput support because of bug 917.
This reverts commit f377e6f4af.
2008-06-15 14:09:12 +03:00
Kalle Olavi Niemitalo
1661109a99 Revert "copiousoutput: I'm not sure about this. pclose may hang ELinks for long time,"
I am reverting all copiousoutput support because of bug 917.
This reverts commit 47f3dd0421.
2008-06-15 14:08:18 +03:00
Kalle Olavi Niemitalo
95c2c941eb Revert "Fix to the new internal copiousoutput handling"
I am reverting all copiousoutput support because of bug 917.
This reverts commit ae58ab8fd7.
2008-06-15 14:06:47 +03:00
Kalle Olavi Niemitalo
01dd1b3b65 Revert "When prompting a program for copiousoutput don't show the block checkbox"
I am reverting all copiousoutput support because of bug 917.
This reverts commit 0c2ce62459.
2008-06-15 14:05:55 +03:00
Witold Filipczyk
1544b5f4b9 bug 991: fix crash when the file is already cached
If the user opens the same file again after it is in the cache, then
ELinks does not always open a new connection, so download->conn can be
NULL in init_type_query(), and download->conn->cgi would crash.
Don't read that, then; instead add a new flag cache_entry.cgi, which
http_got_header() sets or clears as soon as possible after the cache
entry has been created.
(cherry picked from commit 81f8ee1fa2)
2008-06-15 13:53:34 +03:00
Witold Filipczyk
d15439edff bug 991: Added the bit field cgi to the structs connection and type_query.
CGI scripts are distinguishable from normal files. I hope that this
fixes the bug 991. This commit also reverts the previous revert.
(cherry picked from commit 7ceba1e461)
2008-06-15 13:07:02 +03:00
Kalle Olavi Niemitalo
a3fba83f80 Remove a comment about kill_timer()
The comment said "it is not possible to call kill_timer from a timer
handler."  Sure, such calls used to crash occasionally, but that was
bug 868 and has already been fixed.
2008-06-15 11:41:52 +03:00
Kalle Olavi Niemitalo
d6fd2ac31f Erase progress.timer before calling progress.timer_func
Previously, each progress timer function registered with
start_update_progress() was directly used as the timer function of
progress.timer, so it was responsible of erasing the expired timer ID
from that member.  Failing to do this could result in heap corruption.
The progress timer functions normally fulfilled the requirement by
calling update_progress(), but one such function upload_stat_timer()
had to erase the timer ID on its own too.

Now instead, there is a wrapper function progress_timeout(), which
progress.c sets as the timer function of progress.timer.  This wrapper
erases the expired timer ID from progress.timer and then calls the
progress timer function registered with start_update_progress().  So
the progress timer function is no longer responsible of erasing the
timer ID and there's no risk that it could fail to do that in some
error situation.

This commit introduces a new risk though.  Previously, if the struct
progress was freed while the timer was running, the (progress) timer
function would still be called, and it would be able to detect that
the progress pointer is NULL and recover from this situation.  Now,
the timer function progress_timeout() has a pointer to the struct
progress and will dereference that pointer without being able to check
whether the structure has been freed.  Fortunately, done_progress()
asserts that the timer is not running, so this should not occur.
2008-06-15 11:27:19 +03:00
Miciah Dashiel Butler Masters
5c96d430c9 Bug 765: Bypass checks on base tab's view state when copying to a new tab
In setup_session, use copy_location, add_to_history, and
render_document_frames instead of goto_uri and copy_vs to copy the base
tab's view state.  By avoiding goto_uri, setup_session now bypasses MIME
checks, form post confirmations, malicious URL checks, and so on when
copying the base tab's current location and view state to the new tab,
so the new tab should get exactly what was loaded in the base tab.

This fixes bug 765: Opening a new tab can ask about the document of the
previous tab.
2008-06-11 10:32:02 +00:00
Miciah Dashiel Butler Masters
9e1e94bee0 Bug 620: Reset form fields to default values on reload
Do not retain changed values in form fields when the user reloads.  Doing
so can be confusing or even cause data-loss when new default values are
specified in the updated document.  For example, when editing an article on
Wikipedia, one loads the edit page for the article, makes and submits
changes, goes back to the edit page to make further modifications, and
reloads to get the new article text.  Before this change, reloading the
edit page would not update the textarea on the page with the new article
source, which can lead one (and has led me) to make changes to the original
version of the article by accident.

This fixes bug 620.
2008-06-10 06:41:34 +00:00
Kalle Olavi Niemitalo
696496e831 1008: remove unused uri.big_files
The files are instead counted by open_http_post().
2008-06-10 01:05:39 +03:00
Kalle Olavi Niemitalo
a833d6d093 Bug 1015: Define and use Py_ssize_t. 2008-06-09 23:18:03 +03:00
Miciah Dashiel Butler Masters
86db3461b8 Bug 963: Parse scripts in blocks hidden with "display: none"
Handle <script> blocks even when they are contained by blocks with
"display: none" set.

This commit fixes the second problem that Kalle points out in comment 5
to bug 963.
2008-06-09 13:58:41 +00:00
Miciah Dashiel Butler Masters
cadd2ecc10 Bug 963: Correct reversed logic for document.css.ignore_display_none
When this option is enabled, elements should be rendered even when the CSS
display attribute is "none".  Before this commit, the reverse was true:
when the option was enabled, such elements were _not_ rendered.

I am not changing the default, which is enabled, meaning that by default,
ELinks renders elements regardless of "display: none".  Pasky advocates
that this remain the default until ELinks's CSS support improves.

This commit fixes the first problem that Kalle points out in comment 5 to
bug 963.
2008-06-09 13:58:41 +00:00
Miciah Dashiel Butler Masters
9af30f13b9 Document start_element and end_element 2008-06-09 13:58:41 +00:00
Miciah Dashiel Butler Masters
3c44a88b39 Document the invisible and name members of struct html_element 2008-06-09 13:58:41 +00:00
Kalle Olavi Niemitalo
af1f475417 Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:

	doc/man/man1/elinks.1.in
	doc/man/man5/elinks.conf.5

Resolved by regenerating the files with make update-man.
2008-06-08 20:47:36 +03:00
Kalle Olavi Niemitalo
5e4a565603 Bug 1014: Fix incompatible pointer type in init_perl.
The second argument of PERL_SYS_INIT3 should be a char ***
but ELinks was giving it a char *(*)[1].

Also, enlarge the array to 2 elements, so that my_argv[my_argc] == NULL
like in main().  PERL_SYS_INIT3 seems hardly documented at all so I'm
not sure this is necessary, but it shouldn't hurt.
(cherry picked from commit 8d0677e76a)
2008-06-08 20:40:17 +03:00
Kalle Olavi Niemitalo
b8b54a5325 Merge branch 'top/0.13/bug1008' into elinks-0.13 2008-06-08 19:51:00 +03:00
Kalle Olavi Niemitalo
d2da3f4967 1008: larger POST_BUFFER_SIZE for CPU efficiency
Posting a 91762123-byte file to test/cgi/big_file.cgi.  The CPU
percentages are from "top" set up to update every 10 seconds and
checked near the end of the transfer, so they are less accurate
than the upload rate, which averages over the whole transfer.

buffer=4096: average 1.7 MiB/s, elinks 62% CPU, python 35% CPU.
buffer=8192: average 2.5 MiB/s, elinks 49% CPU, python 42% CPU.
buffer=16384: average 3.1 MiB/s, elinks 40% CPU, python 55% CPU.
buffer=32768: average 3.8 MiB/s, elinks 33% CPU, python 61% CPU.
buffer=65536: average 4.1 MiB/s, elinks 26% CPU, python 70% CPU.
buffer=131072: average 4.2 MiB/s, elinks 28% CPU, python 67% CPU.
buffer=262144: average 4.4 MiB/s, elinks 26% CPU, python 69% CPU.

I'm choosing 32768 as POST_BUFFER_SIZE because the advantages of
larger buffers don't seem very high and keeping this under 65536
may help anyone trying to port ELinks to DOS.

I'm using the same value for HTTP too, just to keep things consistent
until there is a reason to diverge.
2008-06-08 18:38:48 +03:00
Kalle Olavi Niemitalo
5839aa070a 1008: show upload progress in local CGI too 2008-06-08 17:30:17 +03:00
Kalle Olavi Niemitalo
bed84c483e Bug 517: read_encoded() == 0 might not mean EOF if non-blocking.
Without this patch, ELinks showed garbage at
<http://www.dwheeler.com/oss_fs_why.html> when bzip2 decompression was
enabled.  safe_read() in bzip2_read() did not see all of the body
bytes that ELinks had received from the server.  After bzip2_read()
received EAGAIN from safe_read() and returned 0, something skipped
1460 bytes.

decompress_data() apparently assumed that read_encoded() returning 0
meant the end of the file, and returned even though len still was
nonzero, i.e. it had not yet written to the pipe all the data that
the caller (read_chunked_http_data() or read_normal_http_data()) had
provided.  The caller did not know this, and discarded the data.
(cherry picked from commit 7e5e05ca60)
2008-06-07 23:33:23 +03:00
Kalle Olavi Niemitalo
7e5e05ca60 Bug 517: read_encoded() == 0 might not mean EOF if non-blocking.
Without this patch, ELinks showed garbage at
<http://www.dwheeler.com/oss_fs_why.html> when bzip2 decompression was
enabled.  safe_read() in bzip2_read() did not see all of the body
bytes that ELinks had received from the server.  After bzip2_read()
received EAGAIN from safe_read() and returned 0, something skipped
1460 bytes.

decompress_data() apparently assumed that read_encoded() returning 0
meant the end of the file, and returned even though len still was
nonzero, i.e. it had not yet written to the pipe all the data that
the caller (read_chunked_http_data() or read_normal_http_data()) had
provided.  The caller did not know this, and discarded the data.
2008-06-07 21:27:37 +03:00
Kalle Olavi Niemitalo
3e370677c4 1008: assert there's no FILE_CHAR in file names 2008-06-04 01:15:07 +03:00
Kalle Olavi Niemitalo
8e33098306 1008: always erase timer ID in upload_stat_timer() 2008-06-03 10:02:06 +03:00
Kalle Olavi Niemitalo
08941fd47d 1008: rename connection.upload_progress to .http_upload_progress 2008-06-03 09:57:58 +03:00
Kalle Olavi Niemitalo
fa51846f68 1008: increment http_post->uploaded in read_http_post() 2008-06-03 09:45:40 +03:00
Kalle Olavi Niemitalo
2d2cc6c5f5 1008: Abort connection if a file is resized. 2008-06-03 01:49:10 +03:00
Kalle Olavi Niemitalo
d3ee4e2e47 1008: error parameter in read_http_post
This function will need to set ELinks-specific errors
and it would not be right to write those in errno.
2008-06-03 01:26:19 +03:00
Kalle Olavi Niemitalo
44bf538cab 1008: Remember the sizes of files during the upload.
This will soon allow read_http_post_fd() to detect if a size has
changed.
2008-06-03 00:46:12 +03:00
Kalle Olavi Niemitalo
c2d854b240 1008: open_http_post() can return an error.
It does not yet take advantage of that though.
2008-06-03 00:18:47 +03:00
Kalle Olavi Niemitalo
533e7fc62b 1008: replace post_length() with open_http_post() 2008-06-02 10:41:55 +03:00
Kalle Olavi Niemitalo
88a59a06c0 1008: move stuff to new src/protocol/http/post.{c,h} 2008-06-02 10:40:34 +03:00
Kalle Olavi Niemitalo
0a95ae85ab 1008: finish renaming http_read_post_data to read_http_post
Fix the compilation error caused in the previous commit.
2008-06-02 01:06:23 +03:00
Paul B. Mahol
b03ddccf08 Recognize Insert key on cons25 (FreeBSD console) 2008-05-31 13:04:25 +03:00
Kalle Olavi Niemitalo
4768243d0c 1008: rename http_read_post_data to read_http_post 2008-05-26 10:40:43 +03:00
Kalle Olavi Niemitalo
1b707208d3 1008: New struct http_post.
Move connection.post_fd to http_post.post_fd.
Make connection.done point to the new done_http_connection(),
which calls the new done_http_post(), which closes post_fd.
So done_connection() no longer needs to do that.

Now that done_http_post() exists, a later commit can add dynamically
allocated data in struct http_post and ensure that it will be freed.
2008-05-26 01:56:58 +03:00
Kalle Olavi Niemitalo
6e616e4f93 1008: Remove assertion from init_http_connection_info().
As the comment near the end of this function says, conn->info is
already non-NULL if a HTTPS proxy is being used, and the code in fact
correctly frees the previous info.  So there is no need to assert its
nonexistence.  I added that bug on 2008-05-22, in commit 291a913d1e.
2008-05-25 22:40:27 +03:00
Kalle Olavi Niemitalo
7a72a685e5 1008: Centralize random numbers.
If ELinks is being linked with SSL library, use its random number
generator.

Otherwise, try /dev/urandom and /dev/prandom.  If they do not work,
fall back to rand(), calling srand() only once.  This fallback is
mostly interesting for the Hurd and Microsoft Windows.

BitTorrent piece selection and dom/test/html-mangle.c still use rand()
(but not srand()) directly.  Those would not benefit from being
unpredictable, I think.
2008-05-25 18:44:21 +03:00
Kalle Olavi Niemitalo
291a913d1e 1008: Call and reset conn->done when freeing conn->info.
In the places that set conn->info without freeing the original value,
assert that both conn->info and conn->done are NULL.
2008-05-22 03:59:33 +03:00
Kalle Olavi Niemitalo
2256a8c94a 1008: HTTP upload counters are off_t, not size_t.
So that ELinks can upload files larger than 4 GiB even if size_t is
32-bit.
2008-05-21 08:20:03 +03:00
Kalle Olavi Niemitalo
3b5e10d3da 1008: Merge POST data sending of HTTP and local CGI.
To reduce code duplication, src/protocol/file/cgi.c no longer parses
connection->uri->post on its own but rather calls the new function
http_read_post_data(), provided by src/protocol/http/http.c.  The same
code is now also used for POST requests that do not include files.
2008-05-19 08:09:39 +03:00
Kalle Olavi Niemitalo
181486696b 1008: comments about struct http_connection_info 2008-05-18 22:30:30 +03:00
Witold Filipczyk
5c885def9b 1008: Do not check boundaries, use random ones. 2008-05-17 18:20:13 +02:00
Kalle Olavi Niemitalo
0298d88167 1008: Save errno if open() fails in file upload. 2008-05-17 10:39:10 +03:00
Miciah Dashiel Butler Masters
e174b9b023 Drop unused local variable scriptlen and strlen call in execute_cgi 2008-05-16 04:00:18 +00:00
Witold Filipczyk
ffcd91a30d 1008: Comments.
G: -----------------------------------------------------------------------
2008-05-12 13:01:51 +02:00
Witold Filipczyk
f09a5f235e 1008: s/big_file/file/g . 2008-05-12 12:51:53 +02:00
Witold Filipczyk
9f768354b9 1008: Moved the definition of the big_files_offset to the form.c. 2008-05-12 12:42:43 +02:00
Witold Filipczyk
5458346e6e 1008: Use the new code for all files, not only for bigger ones. 2008-05-12 12:37:00 +02:00
Witold Filipczyk
20f0ed6e1b 1008: Added a comment realted to http_version's macros. 2008-05-12 11:50:40 +02:00
Witold Filipczyk
639799740c 1008: Changed misleading comment. 2008-05-12 11:48:41 +02:00
Witold Filipczyk
df2e601d9b 1008: Added a comment about use of the struct http_version. 2008-05-12 11:46:09 +02:00
Witold Filipczyk
a85a87a574 1008: abort connection when opening a big file fails. 2008-05-12 11:37:48 +02:00
Witold Filipczyk
a6184b3081 1008: Moved post_fd to the struct connection. 2008-05-12 11:24:00 +02:00
Miciah Dashiel Butler Masters
9e04b0ec8c Fix bug 944: avoid duplicate type-query handlers
Previously, init_type_query would check to make sure that it doesn't create a
duplicate type query and would return NULL if it otherwise would create a
duplicate.  Then setup_download_handler would return 0 to do_move.

This patch changes setup_download_handler to return 1 to do_move in this
situation so that do_move stops trying to load the document.

This avoid a crash when loading twice the same file in the same tab when
loading the file opens a type query.
2008-05-11 15:42:21 +00:00
Witold Filipczyk
a14cad36ba 1008: big_files is unsigned int. 2008-05-11 13:14:12 +02:00
Witold Filipczyk
8508c18341 1008: big uploads. Added info in the status bar about uploded data. 2008-05-11 13:14:06 +02:00
Witold Filipczyk
6c0979aae9 1008: Added upload_progress to the connection. 2008-05-11 13:14:00 +02:00
Witold Filipczyk
a685470da9 1008: Added the total_upload_length and uploaded to the http_info. 2008-05-11 13:13:55 +02:00
Witold Filipczyk
ec382345c8 1008: upload of big files.
Files bigger than 65536 bytes are loaded on "demand".
TODO: Add a progress bar of uploads.
2008-05-11 13:13:49 +02:00
Kalle Olavi Niemitalo
d26c8cf836 Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:

	NEWS (bug 939 was listed twice)
	doc/man/man5/elinks.conf.5 (regenerated)
	po/fr.po (only in comments and such)
	po/pl.po (only in comments and such)
	src/protocol/fsp/fsp.c (the relevant changes were already here)
2008-04-28 22:08:19 +03:00
Kalle Olavi Niemitalo
2463c1b2f8 Bug 939: Documented the fix.
The fix itself is in the parent commit.
(cherry picked from commit 4c390589ea,
 rewriting the NEWS entry because the bug also occurred on Debian)
2008-04-28 11:04:27 +03:00
Witold Filipczyk
8a02678bed 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.
(cherry picked from commit 06bcc48487)
2008-04-28 11:04:06 +03:00
Witold Filipczyk
232c07aa7f bug 1009: id variables renamed, added document_id to the document.
cached->id => cached->cache_id
document->id => document->cache_id
onload_snippets_owner => onload_snippets_document_id
Added the distinct document->document_id.
Always reset ecmascript when a document changes for example a next chunk
of it is loaded.
2008-04-27 23:22:08 +03:00
Witold Filipczyk
f994ef4335 mkalldirs: Reset ret when errno is EEXIST.
This bug was revelead while using bittorrent.
For filenames started with a dot and two slashes .//
the open_bittorrent_file returned -1 and set errno to EEXIST.
2008-03-29 18:41:22 +02:00
Witold Filipczyk
08894be379 bittorrent: Overflow occuring when a piece was rejected. 2008-03-25 22:35:06 +01:00
Kalle Olavi Niemitalo
4b408dd860 Display subtrees last in --config-help.
elinks --config-help used to sort options like this:

  document.history
  document.history.global
    document.history.global.enable
    document.history.global.max_items
    document.history.global.display_type
    document.history.keep_unhistory

Now it'll instead be:

  document.history
    document.history.keep_unhistory
  document.history.global
    document.history.global.enable
    document.history.global.max_items
    document.history.global.display_type

i.e. all the options listed under a subheading are children of the
tree named by it.  This makes elinks.conf(5) look saner.
2008-03-23 19:20:12 +02:00
Kalle Olavi Niemitalo
aae5788cc7 bug 638: More comments. Assert that calls don't nest. 2008-03-22 14:06:47 +02:00
Witold Filipczyk
4eefa983de bug 638: Save, set and restore the DISPLAY environment variable.
Thanks to this trick the appropriate handler is executed,
even in a mixed (X11, framebuffer) environment.
2008-03-22 13:08:39 +02:00
Witold Filipczyk
81f8ee1fa2 bug 991: fix crash when the file is already cached
If the user opens the same file again after it is in the cache, then
ELinks does not always open a new connection, so download->conn can be
NULL in init_type_query(), and download->conn->cgi would crash.
Don't read that, then; instead add a new flag cache_entry.cgi, which
http_got_header() sets or clears as soon as possible after the cache
entry has been created.
2008-03-15 20:49:15 +02:00
Witold Filipczyk
2aa70f77bc bug 991: Added the bit field cgi to the structs connection and type_query.
CGI scripts are distinguishable from normal files. I hope that this
fixes the bug 991. This commit also reverts the previous revert.
(cherry picked from commit 7ceba1e461)
2008-03-15 19:25:01 +02:00
Kalle Olavi Niemitalo
fb966b87a3 Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:

	doc/Doxyfile.in
2008-03-15 19:24:51 +02:00
Witold Filipczyk
dafb726a49 bug 976: do not use stdout and stderr in a child processing smb://
libsmbclient's stdout and stderr interferred with ELinks's stdout
and stdin. That caused an assertion failure. Now the ELinks uses
different streams for processing of the smb protocol.
2008-03-15 18:09:23 +02:00
Kalle Olavi Niemitalo
cd4a9d77b9 Revert "bug 991: Added the bit field cgi to the structs connection and type_query."
This reverts commit 7ceba1e461,
which is causing an assertion to fail if I open the same PDF
twice in a row, even if I cancel the dialog box when ELinks
first asks which program to run:

INTERNAL ERROR at /home/Kalle/src/elinks-0.12/src/session/download.c:980: assertion download && download->conn failed!

Forcing core dump! Man the Lifeboats! Women and children first!

But please DO NOT report this as a segfault!!! It is an internal error, not a
normal segfault, there is a huge difference in these for us the developers.
Also, noting the EXACT error you got above is crucial for hunting the problem
down. Thanks, and please get in touch with us.

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1216698688 (LWP 17877)]
0xb7a02d76 in raise () from /lib/libc.so.6
(gdb) backtrace 6
    at /home/Kalle/src/elinks-0.12/src/util/error.c:179
    fmt=0x816984c "assertion download && download->conn failed!")
    at /home/Kalle/src/elinks-0.12/src/util/error.c:122
    cached=0x8253ca8) at /home/Kalle/src/elinks-0.12/src/session/download.c:980
    cached=0x8253ca8, frame=0)
    at /home/Kalle/src/elinks-0.12/src/session/download.c:1339
    at /home/Kalle/src/elinks-0.12/src/session/task.c:493
(More stack frames follow...)

There is a fix available but I don't trust it yet.
2008-03-11 10:51:20 +02:00
Witold Filipczyk
7ceba1e461 bug 991: Added the bit field cgi to the structs connection and type_query.
CGI scripts are distinguishable from normal files. I hope that this
fixes the bug 991. This commit also reverts the previous revert.
2008-03-09 15:47:35 +02:00
Kalle Olavi Niemitalo
13a04b8fbc Bug 991: Revert "When requested to open local files with a handler use the file in place"
This reverts commit d0be89a16c, and thus
restores the ELinks 0.11 behaviour: always copy the data to a
temporary file before passing it to a MIME handler, even if the
"file:" URI scheme is being used.  Previously, ELinks 0.12.GIT passed
the name of the original file directly to the handler.  That was more
efficient but unfortunately gave the wrong result with local CGI.

The commit being reverted also claims to partially fix bug 238
(caching of local files).  That bug is still open.
2008-03-08 21:20:58 +02:00
Kalle Olavi Niemitalo
5419414b59 Bug 991: Tell users not to quote % in MIME handlers.
ELinks quotes the file name automatically and user-written quote
characters would just interfere with that.
2008-03-08 21:20:58 +02:00
Witold Filipczyk
19079733df Bug 991: URI-decode and shell-quote file name for MIME handler
Currently, when ELinks passes the name of a local file to an external
MIME handler program, it encodes the name as a URI.  Programs
typically do not expect this, and they then fail to open the file.
This patch makes ELinks instead quote the file name for the shell.

(The patch was attachment 425 of bug 991, by Witold Filipczyk.
 This commit message was written by Kalle Olavi Niemitalo.)
2008-03-08 21:20:58 +02:00
Witold Filipczyk
a6966e9472 Bug 991: Replace '%s' by % in the mailcap.c
Currently, when ELinks passes the name of a local file to an external
MIME handler program, it encodes the name as a URI.  Programs
typically do not expect this, and they then fail to open the file.
ELinks should instead quote the file name for the shell.
Unfortunately, Debian has lines like this in /etc/mailcap:

audio/mpeg; xmms '%s'; test=test "$DISPLAY" != ""

If ELinks were changed to replace the %s with e.g.
'/home/Kalle/doc/Topfield/How to upgraded the Firmware(English).pdf'
(quotes included), then the quotes would cancel out and the shell
would split the file name into multiple arguments.  That could even
provide a way for malicious persons to make ELinks run arbitrary
shell commands.

The examples in RFC 1524 all have %s without any quotes.
Debian has two bug reports about the quoting behaviour:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=90483
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=221717

This patch therefore tries to detect whether the %s has been quoted
already, and remove the quotes if so.  That way, the next patch will
be able to safely add its own quotes.  This removal of quotes applies
only to mailcap files; MIME handlers defined in elinks.conf should
already be in the format preferred by ELinks.

(The patch was attachment 438 of bug 991, by Witold Filipczyk.
 This commit message was written by Kalle Olavi Niemitalo.)
2008-03-08 21:20:57 +02:00
Kalle Olavi Niemitalo
bff789d421 Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:

	doc/elinks.conf.5.txt
	src/mime/dialogs.c (resolved by Witold Filipczyk)
2008-03-08 15:35:12 +02:00
Jonas Fonseca
e04b420897 Minor fixes and improvements to option strings
This syncs some changes (ie. -> e.g. etc.) from elinks-0.12 or beyond.
I noticed them while updating the web pages, and apologize that I will
not spent the time to attribute it to the individual commits.

(cherry picked from commit 2bfc7b3724,
 omitting generated files)
2008-03-06 10:31:20 +02:00
Kalle Olavi Niemitalo
4d06362a50 Mark option changed in "File extensions -> Add".
Previously, file extensions added or modified via the menu did not get
saved to elinks.conf when config.saving_style was 3 (the default).
This patch makes the file-extension dialog box call option_changed,
which then sets OPT_TOUCHED, so that the option appears modified in
the option manager and will be saved.

Reported and patch reviewed by Witold Filipczyk.
2008-03-04 23:33:05 +02:00
Witold Filipczyk
8f46de65d6 bug 1000: Do not discard the query part of URI.
(cherry picked from commit 3a4c053bd5)
2008-03-02 17:45:29 +02:00
Kalle Olavi Niemitalo
3a9b5d091d Enable protocol.http.compression by default.
AFAIK, all bugs in it have been fixed.  Some bugs may still be lurking
but they are more likely to get caught if compression is enabled.

I also replaced COMP_NOTE with static text because xgettext does not
support macros in the argument of N_.
2008-03-01 19:30:04 +02:00
Kalle Olavi Niemitalo
af9ed54c0f Merge branch 'elinks-0.12' into elinks-0.13 2008-03-01 17:28:37 +02:00
Kalle Olavi Niemitalo
8b5de30f72 Bug 1001: fix uninitialized-pointer crash in URI rewriting
(cherry picked from commit 6d2e034007)
2008-03-01 16:09:41 +02:00
Kalle Olavi Niemitalo
b0c5da3ddf BUILD_ID: Fix dirt check when srcdir != builddir.
I also tried git --work-tree=$(top_srcdir) but did not get it to work.
2008-03-01 14:30:57 +02:00
Kalle Olavi Niemitalo
747b32b735 BUILD_ID: Show the full SHA-1, instead of git describe.
Git describe happily picks whatever annotated tag is closest to the
commit.  I make use of many annotated tags that correspond not to
ELinks releases but rather to patches posted in bugzilla or sent in
email.  So with git describe, the About window can display e.g.
"email/witekfl/2008-02-29-2-g705acfa-dirty", which is not the intended
use of this tag.

In the "next" branch of git.git, git describe apparently supports a
--match option with which it could be made to consider ELinks releases
only.  However, that option is not yet in any released version of Git,
and anyhow ELinks should support older versions too.

Instead of using git describe, just show the full SHA-1, like
cg-commit-id would.  The About dialog box also displays VERSION
from configure.in, so it isn't even particularly useful to show
the name of the latest tag.  (The commit count might help though.)
2008-03-01 14:01:28 +02:00
Jonas Fonseca
705acfa05a Use git tools instead of cogito for getting the build ID
The build ID now includes both last tagged version, commit generation
since last tagged version, as well as the leading characters of the
commit ID and a flag for dirty working tree.
(cherry picked from commit c2a0d3b969)
2008-03-01 13:55:16 +02:00
Witold Filipczyk
d8a062cffc http encoding: Moved the accept_encoding_header to the http.c. 2008-02-29 15:32:10 +01:00
Jonas Fonseca
8bb0f20471 FTP: Test and fix handling of symbolic link name containing spaces
The bug was reported by Paul B. Mahol on elinks-users. The example is
from the FTP site he provided:

	ftp.freebsd.org/pub/FreeBSD/ISO-IMAGES-ia64/

Message-ID: <3a142e750802262008l6fd55be5v44207bc4479dd3fc@mail.gmail.com>
(cherry picked from commit c069403b75)
2008-02-28 23:39:04 +02:00
Jonas Fonseca
1ad9d5b2b8 Fix the FTP parser test program to handle multiline responses
... so all the tests with responses stretching multiple lines are
actually tested in their entirety.

(cherry picked from commit aa9a847c00,
 resolving a conflict due to the use of get_test_opt)
2008-02-28 23:38:55 +02:00
Jonas Fonseca
577c241438 parse_time: set tm_sec to zero before conditional second parsing
This fixes test 9 (Basic VMS responses) that uses time specs with
seconds left out (e.g. 17:44) for me.
(cherry picked from commit 397bef882b)
2008-02-28 23:38:42 +02:00
Kalle Olavi Niemitalo
3aecdfc095 Content-Encoding: deflate means neither zlib nor gzip header.
deflate.c used to call inflateInit2(stream, MAX_WBITS + 32).
This makes zlib first check for a gzip header, and if it doesn't
find one, assume a zlib header.  However, if the server said
"Content-Encoding: deflate", then neither header is there, and
zlib does not detect this automatically.  So ELinks has to
distinguish between the gzip and deflate encodings, and tell
zlib which one was meant.

This bug resulted in blank pages at blogs.msdn.com accessed
through proxy.suomi.net.
2008-02-27 00:52:24 +02:00
Kalle Olavi Niemitalo
3c861fd530 Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:

	configure.in
	src/protocol/http/http.c
2008-02-24 22:49:47 +02:00
Kalle Olavi Niemitalo
a03698d695 lzma: Set *new_len even if data was truncated.
Commit 474f1f4268 did the same
to bzip2 and deflate.
2008-02-24 20:45:33 +02:00
Witold Filipczyk
26607d2263 decompress_data: Do not leak memory in mem_realloc. 2008-02-24 20:45:33 +02:00
Witold Filipczyk
902522fbdf content encoding: New function accept_encoding_header. 2008-02-24 20:45:32 +02:00
Witold Filipczyk
8492e6b1af lzma: used the lzma library from tukaani.org. 2008-02-24 20:45:32 +02:00
Kalle Olavi Niemitalo
a7232792dd encoding: Don't leak a pipe fd if open_encoded() fails. 2008-02-17 21:54:19 +02:00
Kalle Olavi Niemitalo
474f1f4268 encoding: Set *new_len even if data was truncated.
Previously, bzip2_decode_buffer and deflate_decode_buffer left
*new_len unchanged if the compressed input data ended unexpectedly.
This behaviour was also inherited by decode_encoded_buffer,
whose only caller render_encoded_document preinitializes the variable
and so did not crash.

With this change, the functions now store in *new_len the number of
bytes that were successfully decoded, even if more bytes were expected.
An error should perhaps be reported to the user, but I don't think the
previous version did that either, as it returned a non-NULL pointer.
2008-02-17 21:54:19 +02:00
Witold Filipczyk
0b363eb245 content encoding: handle the case when the len is 0 in the chunked encoding.
We do not want to start decompression when the len is 0
with the chunked encoding.
2008-02-17 21:54:18 +02:00
Witold Filipczyk
cfb2ef63d6 encoding: Fixed a chunked decompression and added the deflate. 2008-02-17 21:54:18 +02:00
Y Giridhar Appaji Nag
4a1e296c3b Bug 1002: Fix build failure on Debian GNU/Linux arch powerpc
Change char id to enum bittorrent_message_id id to prevent FTBFS on
powerpc and s390
(cherry picked from commit 01b0c81227,
 with a conflict)
2008-02-10 14:34:21 +02:00
Kalle Olavi Niemitalo
76d803bbb9 config: Count backslashed newlines in str_rd.
If a newline has a backslash in front of it, then str_rd replaces it
with a space.  However, the newline was in the original config file,
so the line number must still be incremented.
2008-02-10 14:30:26 +02:00
Kalle Olavi Niemitalo
61019c3130 Debian bug 464384: fix OFF_T_FORMAT mismatches on amd64
On AMD64 apparently, off_t is long but ELinks detected SIZEOF_OFF_T == 8
and defined OFF_T_FORMAT as "lld", which expects long long and so causes
GCC to warn about a mismatching format specifier.  Because --enable-debug
adds -Werror to $CFLAGS, this warning breaks the build.  When both
SIZEOF_LONG and SIZEOF_LONG_LONG are 8, ELinks cannot know which type
it should use.

To fix this, do not attempt to find a format specifier for off_t itself.
Instead cast all printed off_t values to a new typedef off_print_T that
is large enough, and replace OFF_T_FORMAT with OFF_PRINT_FORMAT which
is suitable for off_print_T altough not necessarily for off_t.  ELinks
already had a similar scheme with time_print_T and TIME_PRINT_FORMAT.
2008-02-10 11:30:27 +02:00
Kalle Olavi Niemitalo
6555359f8e Debian bug 464384: fix cast warning in ssl_connect
There are warnings about casts in the Debian amd64 build logs:
http://buildd.debian.org/fetch.cgi?&pkg=elinks&ver=0.11.3-2&arch=amd64&stamp=1200348983&file=log

	[CC]   src/intl/gettext/dcigettext.o
/build/buildd/elinks-0.11.3/src/intl/gettext/dcigettext.c: In function '_nl_find_msg':
/build/buildd/elinks-0.11.3/src/intl/gettext/dcigettext.c:745: warning: cast from pointer to integer of different size
/build/buildd/elinks-0.11.3/src/intl/gettext/dcigettext.c:746: warning: cast from pointer to integer of different size
...
	[CC]   src/network/ssl/socket.o
/build/buildd/elinks-0.11.3/src/network/ssl/socket.c: In function 'ssl_connect':
/build/buildd/elinks-0.11.3/src/network/ssl/socket.c:219: warning: cast to pointer from integer of different size

The warnings in _nl_find_msg were caused by alignof, which I already
fixed.  This commit ought to fix the gnutls_transport_set_ptr call in
ssl_connect.  This warning did not yet happen in bug 464384 because
the others broke the build before it got that far.
2008-02-09 15:19:20 +02:00
Laurent MONIN
9ba7079735 Patch: fix for bug 938
This patch prevents  handle_itrm_stdin() and clear_handlers(itrm->in.std) to be
called when -remote is set and in.std < 0.
It adds two assertions for in.std >= 0 in handle_itrm_stdin() and
unhandle_itrm_stdin().
May be a bad fix, please test and review.

[Added a NEWS entry.  --KON]
2008-02-09 14:11:21 +02:00
Kalle Olavi Niemitalo
3b93dcc472 Debian bug 464384: fix cast warning in alignof 2008-02-09 00:24:45 +02:00
Kalle Olavi Niemitalo
814e672736 Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:

	src/osdep/osdep.c
2008-02-04 23:51:42 +02:00
Kalle Olavi Niemitalo
a3d093bd25 Bug 54: Don't disable XON/XOFF flow control.
Do not clear the IXON flag in termios.c_iflag.
Bug 54 did not actually ask for this flag to be kept,
but the cable I am using doesn't seem to have the handshake
lines connected right, so XON/XOFF is a must at 38400 bps,
at least until ELinks learns to send padding based on terminfo.

Any user who has bound actions to Ctrl+S or Ctrl+Q and finds that
they no longer work should just "stty -ixon" before running ELinks.
We don't have any default bindings for those keys, fortunately.
2008-02-04 23:22:15 +02:00
Kalle Olavi Niemitalo
cb1454918a 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.

(cherry picked from commit 87f1661314
 but moved the NEWS entry into the 0.12 section)
2008-02-04 23:19:40 +02:00
Kalle Olavi Niemitalo
5499926cc0 Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:

	po/pl.po
	src/config/conf.c
	src/terminal/kbd.c
2008-02-03 22:30:46 +02:00
Kalle Olavi Niemitalo
054852ae23 config: Fix the "include" command.
Previously, it only pretended to rewrite the configuration file, so it
set or cleared OPT_MUST_SAVE but never changed or output any options.
Now, it actually sets the options when ELinks is loading the
configuration file.  Also, when ELinks is rewriting the configuration
file, it now compares the values in the included file to the current
values of the options, and sets or clears OPT_MUST_SAVE accordingly.
2008-02-03 20:28:27 +02:00
Kalle Olavi Niemitalo
92b430f3dc config: Access OPT_MUST_SAVE in the real option, not alias.
So, if elinks.conf contains a "set" command for an alias and ELinks
updates that, it now knows it doesn't have to append another "set"
command for the underlying option.
2008-02-03 20:27:56 +02:00
Kalle Olavi Niemitalo
c47d3798a3 config: Negate the value in redir_rd too.
So if ELinks is rewriting a configuration file that contains a "set"
command for a negated alias, then it properly writes the value of the
alias, rather than the value of the underlying option.
2008-02-03 20:27:54 +02:00
Kalle Olavi Niemitalo
2dbe6ec34f config: In redir_set, negate the incoming value.
That is, let the setter function of the underlying option store the
negated value.  Previously, redir_set used to tweak the value of the
option after it has already called the underlying setter.
2008-02-03 20:27:52 +02:00
Kalle Olavi Niemitalo
7cdbc908d8 config: Rewrite "set" to "unset" and vice versa.
Also, replace OPT_WATERMARK with OPT_MUST_SAVE, which has the opposite
meaning.

Watermarking of aliases does not yet work correctly in this version.
Neither does the "include" command.
2008-02-03 20:27:48 +02:00
Kalle Olavi Niemitalo
6bd961246a config: Reset OPT_TOUCHED flags after a successful save.
Previously, they were reset by smart_config_string(), which was not
called if the value of the option was saved by rewriting an existing
command in elinks.conf.  Also, it is better to reset the flags only
after the file operations have actually succeeded.
2008-02-03 20:27:45 +02:00
Kalle Olavi Niemitalo
ab8ef9698f config: In saving style 2, save deleted options too.
Previously, ELinks set the OPT_WATERMARK flag in all deleted options
when config.saving_style was 2, thus mostly preventing them from being
saved.  This had the unfortunate consequence that if you started with
no elinks.conf, set config.saving_style = 2, deleted some built-in
option (e.g. a URL rewriting rule), saved the settings, and restarted
ELinks, then the built-in option would reappear.
2008-02-03 20:27:41 +02:00
Kalle Olavi Niemitalo
6d55be2043 config: Let mirroring be implicit unless values are rewritten. 2008-02-03 20:27:37 +02:00
Kalle Olavi Niemitalo
72de752f84 config: Rearrange mirror-or-not checks. 2008-02-03 20:27:08 +02:00
Kalle Olavi Niemitalo
661dda04c9 config: Let "unset" delete built-in options too. 2008-02-03 20:26:50 +02:00
Kalle Olavi Niemitalo
2c9d966c99 config: Unsetting a missing option is not an error. 2008-02-03 14:43:43 +02:00
Kalle Olavi Niemitalo
3f077d109a config: Remember the address and length of the option name.
A later commit will take advantage of this.
2008-02-03 14:43:40 +02:00
Kalle Olavi Niemitalo
e7bd23ff37 config: More cleverly skip unrecognized or malformed commands. 2008-02-03 14:43:38 +02:00
Kalle Olavi Niemitalo
e06416d248 config: Skip values of unrecognized options.
To avoid parsing them as commands.
2008-02-03 14:43:36 +02:00
Kalle Olavi Niemitalo
edad2ddccd config: Report errors before the line number is lost. 2008-02-03 14:43:34 +02:00
Kalle Olavi Niemitalo
1f0c361ead config, Bug 503: Keep track of what has been mirrored. 2008-02-03 14:43:31 +02:00
Kalle Olavi Niemitalo
4c64afec26 config: Add struct conf_parsing_state. 2008-02-03 14:43:29 +02:00
Kalle Olavi Niemitalo
63e82e68e4 config: Reduce the interface offered to exmode. 2008-02-03 14:43:26 +02:00
Kalle Olavi Niemitalo
912cff7975 config: Use memacpy instead of stracpy.
So there is no need to substitute a '\0' into the string, and undo
that afterwards.
2008-02-03 14:43:23 +02:00
Kalle Olavi Niemitalo
753aa3054b config: Fix two bogus end-of-file checks. 2008-02-03 14:43:21 +02:00
Kalle Olavi Niemitalo
09829a0b52 config: Don't mem_free(NULL). 2008-02-03 14:43:18 +02:00
Kalle Olavi Niemitalo
c92cd01e0b config: Plug some memory leaks in error handling. 2008-02-03 14:43:16 +02:00
Kalle Olavi Niemitalo
4960c65f20 config: Explain why get_opt_rec() does not follow OPT_ALIAS. 2008-02-03 14:43:13 +02:00
Kalle Olavi Niemitalo
1d16e90dca config: Swap the "unknown command" and "parse error" messages.
They should be in the same order as in enum parse_error.
2008-02-03 14:43:11 +02:00
Kalle Olavi Niemitalo
b216a21b79 config: Each backslash escapes only one character.
Previously, if you did this in elinks.conf:
set document.dump.header = "\'\\"
then str_rd() failed to detect the end of the string.
2008-02-03 14:43:09 +02:00
Kalle Olavi Niemitalo
9becd108a8 config: more const in elinks.conf parsing 2008-02-03 14:43:06 +02:00
Kalle Olavi Niemitalo
11e9a816f5 const in name_to_language 2008-02-03 14:42:07 +02:00
Kalle Olavi Niemitalo
cb90ed94f0 const in get_cp_index 2008-02-03 14:41:35 +02:00
Kalle Olavi Niemitalo
49ea10a74d Bug 994: Treat only termios.c_cc[VERASE] as "Backspace".
When setting the tty device to raw mode, save the VERASE character.
Later, compare incoming bytes to that.

This is somewhat complicated because "stty verase undef"
sets termios.c_cc[VERASE] = _POSIX_VDISABLE, and e.g. Linux
defines _POSIX_VDISABLE as 0 but that must not cause ELinks
to treat incoming null bytes as backspaces.  Furthermore,
some systems may use different VDISABLE values for different
terminal devices, in which case _POSIX_VDISABLE is undefined
and ELinks must instead read the value from fpathconf().
2008-02-02 13:19:55 +02:00
Miciah Dashiel Butler Masters
e6276bf7ac Missing change from last commit 2008-01-27 18:50:29 +00:00
Miciah Dashiel Butler Masters
ad5b6e0a87 Add KEYMAP_INVALID value for enum keymap_id and properly check for it
get_keymap_id returns -1 when it can't find the keymap.  Because the return
type of get_keymap_id is enum keymap_id and enum keymap_id did not have any
explicit values defined, it could be unsigned, which meant that when
get_keymap_id returned -1, it was really returning a huge positive number.
This meant that when callers checker whether the return value was negative,
they were essentially performing no check at all, so they might give
get_keymap_id an invalid keymap name, get back an invalid keymap_id, and
use that invalid keymap_id.

This commit adds KEYMAP_INVALID = -1 to enum keymap_id and makes all
functions that deal with the enumeration use that symbol.
2008-01-27 18:50:29 +00:00
Miciah Dashiel Butler Masters
cf4c38bb39 Missing change from last commit 2008-01-27 18:48:27 +00:00
Miciah Dashiel Butler Masters
4dedef8f66 Add KEYMAP_INVALID value for enum keymap_id and properly check for it
get_keymap_id returns -1 when it can't find the keymap.  Because the return
type of get_keymap_id is enum keymap_id and enum keymap_id did not have any
explicit values defined, it could be unsigned, which meant that when
get_keymap_id returned -1, it was really returning a huge positive number.
This meant that when callers checker whether the return value was negative,
they were essentially performing no check at all, so they might give
get_keymap_id an invalid keymap name, get back an invalid keymap_id, and
use that invalid keymap_id.

This commit adds KEYMAP_INVALID = -1 to enum keymap_id and makes all
functions that deal with the enumeration use that symbol.
2008-01-27 18:47:20 +00:00
Miciah Dashiel Butler Masters
3a0286e447 Strings corrections from Malcolm Parsons
Fix the spelling and grammar in various comments, variable names, comment
descriptions, and documentation.
2008-01-27 04:19:23 +00:00
Miciah Dashiel Butler Masters
643a34e6af Strings corrections from Malcolm Parsons
Fix the spelling and grammar in various comments, variable names, comment
descriptions, and documentation.
2008-01-27 04:09:18 +00:00
Kalle Olavi Niemitalo
dae9b988f6 const in scanner
So that render_dom_document_start() is better assured that
default_colors[] won't be modified by the CSS code.
2008-01-26 18:20:17 +02:00
Kalle Olavi Niemitalo
f0d10c9f29 Add struct bittorrent_const_string.
Previously, struct string was used here.  However,
bittorrent_fetch_callback does not initialize response.magic,
and parse_bittorrent_tracker_response changes response->source
to point to data that must not be freed.  So the util/string.h
functions are not actually safe to use on these objects.
For this reason, it is safer to use a separate type.
2008-01-26 18:16:45 +02:00
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
Witold Filipczyk
d830833e62 move-link-down-line, move-link-prev-line, etc.:
Change mode to NAVIGATE_LINKWISE to preserve the link position when
going back.
(cherry picked from commit 14b37d0362)
(cherry picked from commit a594b2a002)
2007-12-16 01:12:49 +02:00
Witold Filipczyk
cb07a2630c actions: Fixed moving in frames.
(cherry picked from commit 2045574edc)
(cherry picked from commit 02af6696f5)
2007-12-16 01:12:41 +02:00
Witold Filipczyk
52dfc92523 viewer: Added new four actions requested by Ligesh.
move-link-down-line moves the cursor down to the line with a link.
move-link-up-line moves the cursor up to the line with a link.
move-link-prev-line moves to the previous link horizontally.
move-link-next-line moves to the next link horizontally.
(cherry picked from commit 8259a56e99)
(cherry picked from commit 2eb3532416)
2007-12-16 01:12:31 +02:00
Kalle Olavi Niemitalo
f8863183b8 option_types: Add comments to be found by grep.
I was looking for code that handles OPT_COMMAND, so I grepped for it,
but did not immediately find this array.  Next time, I will.
2007-12-16 01:09:18 +02:00
Miciah Dashiel Butler Masters
a2bc397350 Fix NULL-dereference in document_info_dialog if document not yet loaded
It was possible to cause a crash by opening the Document Info box at the
right moment during the loading of a document.
2007-12-01 19:31:23 +00:00
Kalle Olavi Niemitalo
4871ad0643 Comments about arithmetic in scrolling. 2007-11-25 22:28:19 +02:00
Witold Filipczyk
4f2a9eadfc 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)
2007-11-25 22:28:18 +02:00
Witold Filipczyk
54cf868429 Removed not existent function. Spotted by Kalle.
(cherry picked from commit a76ecfb8ca)
2007-11-25 22:28:18 +02:00
Witold Filipczyk
f62eca8d92 move-link-up-line and others: changed mode to NAVIGATE_CURSOR_ROUTING when
there is no link.
(cherry picked from commit 7db2f8c629)
2007-11-25 22:28:18 +02:00
Witold Filipczyk
3a87ec55fc New action: move-cursor-line-start.
It moves cursor to the start of the line.
(cherry picked from commit 5ee1d3b2b3)
2007-11-25 22:28:18 +02:00
Witold Filipczyk
64c385f0db move-link-prev(next)-line: Typo with cut-n-paste. s/line/last/.
(cherry picked from commit 848852b75f)
2007-11-25 22:28:17 +02:00
Witold Filipczyk
9561d8d0fd move-link-up-line: segfault when cursor was below last line.
(cherry picked from commit c646c860cd)
2007-11-25 22:28:17 +02:00
Witold Filipczyk
1a9112945b move-link-prev-line: Really fixed.
(cherry picked from commit 052f7a93bb)
2007-11-25 22:28:17 +02:00
Witold Filipczyk
27361d141a move-link-prev-line .. move-link-down-line: Fixed.
(cherry picked from commit bb0166279f)
2007-11-25 22:28:17 +02:00
Witold Filipczyk
8863f4335f Fixed the issue with multiline links.
(cherry picked from commit 3555f68059)
2007-11-25 22:28:16 +02:00
Witold Filipczyk
1cbd02c141 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)
2007-11-25 22:28:16 +02:00
Witold Filipczyk
a594b2a002 move-link-down-line, move-link-prev-line, etc.:
Change mode to NAVIGATE_LINKWISE to preserve the link position when
going back.
(cherry picked from commit 14b37d0362)
2007-11-25 22:28:16 +02:00
Witold Filipczyk
02af6696f5 actions: Fixed moving in frames.
(cherry picked from commit 2045574edc)
2007-11-25 22:28:16 +02:00
Witold Filipczyk
2eb3532416 viewer: Added new four actions requested by Ligesh.
move-link-down-line moves the cursor down to the line with a link.
move-link-up-line moves the cursor up to the line with a link.
move-link-prev-line moves to the previous link horizontally.
move-link-next-line moves to the next link horizontally.
(cherry picked from commit 8259a56e99)
2007-11-25 22:28:15 +02:00
Witold Filipczyk
871b4b09dd bug 978: Python's webbrowser.open_new_tab(URL) works since now. 2007-11-22 19:11:03 +01:00
Witold Filipczyk
588e914470 bug 978: Python's webbrowser.open_new_tab(URL) works since now. 2007-11-22 19:10:45 +01:00
Kalle Olavi Niemitalo
dee220026d Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:

	po/fr.po (time stamps only)
2007-11-20 00:41:30 +02:00
Kalle Olavi Niemitalo
e667c43cd3 Bug 975: Fix int/size_t pointer type mismatch.
On machines where sizeof(size_t) > sizeof(int), this could corrupt the stack.
I think -Wno-pointer-sign added by configure hid this bug until now.
STRLEN is correct in Perl 5.6.0 and later, perhaps earlier too.
2007-11-10 19:28:01 +02:00
Laurent MONIN
9297853d20 Fix download led among different sessions, just use are_there_downloads().
It is a partial revert of commit d14f79eb2c.
Most introduced stuff was useless.
2007-11-07 14:01:10 +01:00
Laurent MONIN
b3cfede1c1 Drop @safe parameter of create_download_file().
Use new flag DOWNLOAD_EXTERNAL instead.
2007-11-07 13:33:04 +01:00
Laurent MONIN
71ccbe0f8d Replace resume parameter by more generic flags.
Type download_flags_T and enum download_flag were introduced.
2007-11-07 12:57:13 +01:00
Laurent MONIN
cfdbe749e8 Use sizeof() instead hardcoded value in read_from_popen(). 2007-11-07 12:12:31 +01:00
Laurent MONIN
cdda2f5acd Factor out redundant code in download_data_store(). 2007-11-07 12:08:36 +01:00
Laurent MONIN
2a59f0f5bd Simplify code. 2007-11-07 12:06:24 +01:00
Laurent MONIN
7a74edab5a Fix display of led after download abort. 2007-11-07 12:06:00 +01:00
Laurent MONIN
d14f79eb2c Indicate backgrounded downloads using an unused led.
The sixth position (the last led from the left) is used.
2007-11-07 11:24:52 +01:00
Petr Baudis
6c4e01f483 Disable protocol.http.compression by default
The compression support in ELinks has always been buggy, with some large pages
failing to decompress and containing garbage at the end instead. However,
with the recent attempts to fix the compression support, it has been actually
made *so* buggy that not only these cases seem to occur more often, but in
some cases, the page is just silently chopped and no content visible; in other
cases, "Resource temporarily unavailable" is displayed. Etc.

The compression support got now to the point where it is so awfully unstable
that it is actively harmful to have it enabled by default. I've been burnt by
it several times already and once made a very serious error because of page
being chopped silently.
2007-11-01 02:28:00 +01:00
Petr Baudis
d4cec950ec Introduce protocol.http.compression knob
When disabled, no Accept-Encoding header is sent.
2007-11-01 02:24:55 +01:00
Laurent MONIN
f5c3ba2e99 Add cookies file format description to cookies.h.
This clear description was provided by Witek on IRC.
2007-10-18 09:26:43 +02:00
Laurent MONIN
8f02417036 Insert a new line after variable declaration. 2007-10-15 12:59:41 +02:00
Laurent MONIN
a35a5c557a Use @cp to shorten the line. 2007-10-15 12:32:25 +02:00
Laurent MONIN
b1eaca1f1e Drop unused variable @options from html_focusable(). 2007-10-15 12:31:16 +02:00
Laurent MONIN
31d8ffc578 In extract_color() and get_color(), make names of variables more explicit.
c -> attribute
r -> retval
at -> value
2007-10-15 12:26:19 +02:00
Laurent MONIN
a1125df95f Make get_bgcolor() use extract_color() instead of get_color().
It prevents a useless test, use_document_fg_colors() is
always true when use_document_bg_colors() is true.
2007-10-15 12:19:46 +02:00
Laurent MONIN
b709061864 Move code from get_color() to new extract_color(). 2007-10-15 12:17:08 +02:00
Laurent MONIN
11dea66ff1 struct table bordercolor,bgcolor -> color.(border|background) 2007-10-12 17:10:30 +02:00
Laurent MONIN
367767c500 struct par_attrib bgcolor -> color.background 2007-10-12 17:04:44 +02:00
Laurent MONIN
f150f22ac9 Use color.background instead of bgcolor in struct document too.
Not useful but coherent with other changes.
2007-10-12 16:50:47 +02:00
Laurent MONIN
bc498c00da struct text_style_color fg,bg -> foreground, background 2007-10-12 16:41:06 +02:00
Laurent MONIN
f8cdb5d472 More anonymous structures were named. 2007-10-12 16:24:41 +02:00
Laurent MONIN
78270c2ac3 Reduce usage of anonymous structures.
Naming them may ease things (ie. debug).
2007-10-12 12:37:28 +02:00
Laurent MONIN
e2a5696f76 active_link.(fg|bg) -> active_link.color.(foreground|background) 2007-10-12 12:24:53 +02:00
Laurent MONIN
8df72685ce Rename struct active_link_options field color to enable_color.
It matches the corresponding option name better.
2007-10-12 12:19:27 +02:00
Laurent MONIN
24605c967e Mark colors in struct document_options by using a new struct for them.
default_(link|vlink|...) -> default_color.(link|vlink|...)
2007-10-12 12:11:31 +02:00
Laurent MONIN
a5548fadd2 Use (correct) type enum form_mode for struct text_attrib field select_disabled. 2007-10-12 11:00:41 +02:00
Laurent MONIN
192c2a9e12 Use parenthesis around macro parameters.
Macros concerned are:
is_inline_element()
is_block_element()
2007-10-12 10:51:49 +02:00
Laurent MONIN
944a8e7bd9 style.(fg|bg) -> style.color.(fg|bg)
Introduce INIT_TEXT_STYLE() macro to initialize struct text_style.
2007-10-10 14:59:15 +02:00
Laurent MONIN
ca6424595b format.(clink|vlink|...) -> format.color.(clink|vlink|...)
It makes more obvious these fields are colors.
2007-10-10 14:37:10 +02:00
Laurent MONIN
6564aec93f Add a new entry Link Info under Link main menu.
It also adds a Link info entry in the link contextual menu.
No key is associated for now, action was named ACT_MAIN_LINK_INFO.
2007-10-10 10:47:24 +02:00
Miciah Dashiel Butler Masters
eacd0b4308 Drop extra definition of start_document_refresh
It must have come with the merge.  Doh.
2007-10-09 14:43:38 +00:00
Miciah Dashiel Butler Masters
bd8a7c4178 Show the elapsed time since the document was loaded in the document info box 2007-10-09 14:16:36 +00:00
Miciah Dashiel Butler Masters
f2f478eb2f Let CSS selectors select non-pairable elements
This necessitates that non-pairable elements be briefly pushed on the stack, so that get_css_selector_for_element sees them, and then popped.

It would be possible to push them only when CONFIG_CSS is defined, as they are otherwise not needed (as evidenced by the fact that we've gone so long without bothering to push them).  However, the performance hit should be small, the necessary #ifdef/#endif wrappers would be pretty ugly, and ideally, the CSS code will someday be in such a state that it can be considered an integral feature.
2007-10-09 14:14:45 +00:00
Miciah Dashiel Butler Masters
13523248ed Merge commit 'origin/elinks-0.12'
Conflicts:

	po/fr.po
	src/document/dom/renderer.c
	src/document/html/parser.c
	src/document/options.c
	src/document/refresh.c
2007-10-09 14:05:03 +00:00
Kalle Olavi Niemitalo
e2cc0bd434 Don't cast qsort comparison function pointers.
Instead, convert the element pointers inside the comparison functions.

The last argument of qsort() is supposed to be of type
int (*)(const void *, const void *).  Previously, comp_links() was
defined to take struct link * instead of const void *, and the type
mismatch was silenced by casting the function pointer to void *.
This was in principle not portable because:

(1) The different pointer types may have different representations.
    In a word-oriented machine, the const void * might include a byte
    selector while the struct link * might not.

(2) Casting a function pointer to a data pointer can lose bits in some
    memory models.  Apparently this does not occur in POSIX-conforming
    systems though, as dlsym() would fail if it did.

This commit also fixes hits_cmp() and compare_dir_entries(), which
had similar problems.  However, I'm leaving alias_compare() in
src/intl/gettext/localealias.c unchanged for now, so as not to diverge
from the GNU version.

I also checked the bsearch() calls but they were all okay, apart from
one that used the alias_compare() mentioned above.
2007-10-06 23:05:05 +03:00
Laurent MONIN
baf2d47a8c Make copyright info independent from translations.
This is an attempt to make it easier to update without
requiring to update all translations.
Copyright info is now set in setup.h using COPYRIGHT_STRING
2007-10-03 11:53:09 +02:00
Laurent MONIN
11e477a63e ELINKS_HOMEPAGE -> ELINKS_WEBSITE_URL 2007-10-03 11:23:29 +02:00
Laurent MONIN
3f48ae491f Add an "Authors" entry to the Help menu.
It displays the ELinks website's authors page.
2007-10-03 11:16:37 +02:00
Miciah Dashiel Butler Masters
04f1ecc3b5 Merge commit 'origin/master' 2007-09-26 16:28:11 +00:00
Miciah Dashiel Butler Masters
a197bde2f6 Really retry forever when connection.retries = 0
This feature has been broken since zas backported it from Links 0.99pre3 2003-04-20.
2007-09-26 16:18:59 +00:00
Miciah Dashiel Butler Masters
aced375440 Really retry forever when connection.retries = 0
This feature has been broken since zas backported it from Links 0.99pre3 2003-04-20.
2007-09-26 16:18:24 +00:00
Laurent MONIN
05fc8f5169 Fix compilation with --disable-css.
Compilation failed due to missing DEBUG_CSS test.
This was introduced in commit 98260f7970
2007-09-24 15:32:42 +02:00
Laurent MONIN
27057926b9 Fix compilation with --disable-css.
Compilation failed due to missing DEBUG_CSS test.
This was introduced in commit 98260f7970
2007-09-21 11:05:40 +02:00
Laurent MONIN
fec10a1846 Revert "format_html_part(): save and restore renderer_context.last_tag_for_newline too."
This reverts commit 60913ba9f9.
This was a bad move, anchors ceased to function correctly.
Reported by Witekfl.
2007-09-19 09:22:44 +02:00
Laurent MONIN
39d9f669c9 Revert "format_html_part(): save and restore renderer_context.last_tag_for_newline too."
This reverts commit 4abce8e363.
This was a bad move, anchors ceased to function correctly.
Reported by Witekfl.
2007-09-19 09:14:53 +02:00
Laurent MONIN
7b6cb249ed Fix compilation using --enable-html-highlight.
It was broken by commit 09cf904814.
Reported by witekfl.
2007-09-17 10:54:52 +02:00
Laurent MONIN
b389d1b20e Revert "Use the new OBJS-unless$(CONFIG_FOO) instead of $(call not,...)"
This reverts commit e07354f5d5.
2007-09-14 17:43:36 +02:00
Kalle Olavi Niemitalo
07535cf886 Define BITTORRENT_NULL_ID in common.c; declare extern in common.h.
This change avoids linker warnings when building with Debian tcc
0.9.23-4 + patch from Debian bug 418360:

      [LD]   src/protocol/bittorrent/lib.o
bittorrent.o: 'BITTORRENT_NULL_ID' defined twice
common.o: 'BITTORRENT_NULL_ID' defined twice
connection.o: 'BITTORRENT_NULL_ID' defined twice
dialogs.o: 'BITTORRENT_NULL_ID' defined twice
peerconnect.o: 'BITTORRENT_NULL_ID' defined twice
peerwire.o: 'BITTORRENT_NULL_ID' defined twice
piececache.o: 'BITTORRENT_NULL_ID' defined twice
tracker.o: 'BITTORRENT_NULL_ID' defined twice
2007-09-14 16:58:16 +02:00
Miciah Dashiel Butler Masters
a46379a931 Move is_in_domain from cookies/cookies.c to protocol/uri.c and export 2007-09-14 16:51:04 +02:00
Jonas Fonseca
e07354f5d5 Use the new OBJS-unless$(CONFIG_FOO) instead of $(call not,...) 2007-09-14 16:48:26 +02:00
Miciah Dashiel Butler Masters
7033247905 Introduce start_document_refreshes()
start_document_refreshes() performs the NULL-pointer checks that
previously all callers to start_document_refresh() must perform
and then calls start_document_refresh().
2007-09-14 16:44:04 +02:00
Jonas Fonseca
8e3c2d6042 Move find_tag to document/document 2007-09-14 16:29:13 +02:00
Laurent MONIN
6c6e75a71d Trim trailing whitespaces. 2007-09-14 15:14:34 +02:00
Laurent MONIN
f0e66866f5 Trim trailing whitespaces. 2007-09-14 15:12:32 +02:00
Jonas Fonseca
890903a65d Compile fix for commit e876df70d8 2007-09-14 15:08:51 +02:00
Petr Baudis
c1b91c7bf3 document/html: Make HTML parser state transparent
Before, *_html_parser_state() operated with struct html_element *. Now, it is
transparent for the renderer (just void *), so that DOM won't have to provide
this struct but will be able to use something internal.

Backported from master.
2007-09-14 15:06:56 +02:00
Petr Baudis
37b20d998c document/html: Move enum html_special_type from parser.h to renderer.h
...since it is renderer interface.
2007-09-14 15:03:14 +02:00
Laurent MONIN
09cf904814 Backport Pasky's changes concerning text_style-related stuff.
It partially includes changes made in following commits:

document/html: struct text_attrib_style -> struct text_style
commit    e133941206

document: struct format_attr -> struct text_style_format
commit    070d335796

document: Unify text style -> screen attribute handling
commit    b66d2bec67

document: Move text_style-related stuff to dedicated format.*
commit    db9431465f
2007-09-14 14:59:37 +02:00
Laurent MONIN
ee503f6c00 Prevent internal errors when terminal width or height are very small
(1x1 was fatal).
2007-09-14 11:49:03 +02:00
Laurent MONIN
e9e8639c8d Improve display of version and features.
Wrap on spaces when features are sent to console using -version,
and let Info dialog do the job in interactive mode.
Insert newlines and remove parenthesis in -version and Info box display.

Backported from master branch.
2007-09-14 10:34:42 +02:00
Laurent MONIN
d6bb586a00 format_html_part(): group int variables declarations 2007-09-14 10:11:44 +02:00
Laurent MONIN
60913ba9f9 format_html_part(): save and restore renderer_context.last_tag_for_newline too. 2007-09-14 10:10:37 +02:00
Laurent MONIN
e914ca85fe Use explicit names for variables in format_html_part().
llm -> saved_last_link_to_move
ltm -> saved_last_tag_to_move
ef  -> saved_empty_format
lm  -> saved_margin
2007-09-14 10:10:09 +02:00
Laurent MONIN
419cd4775e format_html_part(): group int variables declarations 2007-09-14 10:07:32 +02:00
Laurent MONIN
4abce8e363 format_html_part(): save and restore renderer_context.last_tag_for_newline too. 2007-09-14 09:59:34 +02:00
Laurent MONIN
a6f3323a4b Use explicit names for variables in format_html_part().
llm -> saved_last_link_to_move
ltm -> saved_last_tag_to_move
ef  -> saved_empty_format
lm  -> saved_margin
2007-09-14 09:55:43 +02:00
Laurent MONIN
75d47ef957 Drop useless goto/label. 2007-09-14 09:41:51 +02:00
Laurent MONIN
73b1f43468 Drop useless goto/label. 2007-09-14 09:26:39 +02:00
Laurent MONIN
6e89b39ed0 Fix get_opt_bool() call and finish backport of process_head() split. 2007-09-12 23:51:43 +02:00
Miciah Dashiel Butler Masters
bd0a6f6f7d Reflow check_head_for_cache_control 2007-09-12 23:41:37 +02:00
Miciah Dashiel Butler Masters
deb74bd1bd Factor check_head_for_cache_control out of process_head 2007-09-12 23:41:17 +02:00
Miciah Dashiel Butler Masters
4b297a5b03 Factor check_head_for_refresh out of process_head 2007-09-12 23:38:41 +02:00
Miciah Dashiel Butler Masters
23262b3145 Fix process_head to check for cache-control information even if no refresh
Previously, process_head immediately returned if there was no refresh, never giving the cache-control check further down a chance to run.

Also add new tests:

   nocache.html
   refresh+nocache.html
2007-09-12 23:33:40 +02:00
Laurent MONIN
5b28e89026 Extend Use of LWS() macro to parse_old_meta_refresh(). 2007-09-11 17:57:19 +02:00
Laurent MONIN
41ece7a758 Make meta refresh content attribute parsing more tolerant.
Simply search for 'url' marker ignoring anything
before it.
ELinks is now able to follow incorrectly written
meta refresh content attribute with missing ; before
url= parameter.
As an example, try http://akkada.tivi.net.pl/
2007-09-11 17:55:10 +02:00
Jonas Fonseca
8dbd38eded NNTP: Improve listing of articles for groups
It now uses ordered list with the message number as the list item
number. Only the message subject and from field are shown.
2007-09-11 17:01:06 +02:00
Jonas Fonseca
0b0222d64f NNTP: Add support for handling RFC2047 encoded words
Code adapted from git's builtin-mailinfo.c file.
2007-09-11 16:59:56 +02:00
Jonas Fonseca
8393dc901e Bug 744: Make removal of double slashes more protocol specific
Add a boolean protocol flag which says whether "//" in the path
part of an URI can be safely substituted with "/". Be conservative
and enable it only for file://, ftp:// and nntp[s]://. Other
can be turned on later, if needed.

Generalizes the fix from 58b3b1e752.
2007-09-11 14:14:17 +02:00
Jonas Fonseca
5d5f7fc078 NNTP: Fix group listing links having bad URL syntax due to double slashes 2007-09-11 13:50:17 +02:00
Jonas Fonseca
1961a0ca50 NNTP: HTML escape header field values 2007-09-11 13:21:00 +02:00
Laurent MONIN
d650a434b2 Extend Use of LWS() macro to parse_old_meta_refresh(). 2007-09-11 09:30:26 +02:00
Kalle Olavi Niemitalo
db115bfece Add tests for cwd-relative file URIs.
Test 6 currently fails.
2007-09-09 20:06:25 +03:00
Jonas Fonseca
0240c469b7 Merge branch 'elinks-0.12'
Conflicts:

	src/document/dom/renderer.c
2007-09-09 18:25:49 +02:00
Jonas Fonseca
58b3b1e752 Reinstate "canonicalization" of path names for file URIs
This reverts commit 4f0aaa166e
and insert check for the "//" -> "/" change only to occur for
file:// URIs. This fixes the recent reports on broken handling
of relative file URIs starting with "..".
2007-09-09 18:17:25 +02:00
Laurent MONIN
4a6a6909ea Make meta refresh content attribute parsing more tolerant.
Simply search for 'url' marker ignoring anything
before it.
ELinks is now able to follow incorrectly written
meta refresh content attribute with missing ; before
url= parameter.
As an example, try http://akkada.tivi.net.pl/
2007-09-08 21:03:22 +02:00
Miciah Dashiel Butler Masters
dbacc9ead2 Support document refresh in frames
Introduce reload_frame, which takes a frame @name argument in addition to the arguments that reload takes.
2007-09-06 20:47:17 +00:00
Miciah Dashiel Butler Masters
2676fcc2cd do_document_refresh: take document_view instead of session 2007-09-06 19:14:35 +00:00
Miciah Dashiel Butler Masters
66d62ca11b start_document_refresh: take document_view instead of session 2007-09-06 19:13:25 +00:00
Miciah Dashiel Butler Masters
a1a8696cce Introduce start_document_refreshes
start_document_refreshes performs the NULL-pointer checks that previously all callers to start_document_refresh must perform and then calls start_document_refresh.
2007-09-06 18:52:23 +00:00
Miciah Dashiel Butler Masters
a8f28f21c9 Reflow check_head_for_cache_control 2007-09-04 12:13:20 +00:00
Miciah Dashiel Butler Masters
2a2aad15f9 Factor check_head_for_cache_control out of process_head 2007-09-04 12:11:37 +00:00
Miciah Dashiel Butler Masters
fc12376bf5 Factor check_head_for_refresh out of process_head 2007-09-04 12:09:19 +00:00
Miciah Dashiel Butler Masters
2d0180d1e7 Fix process_head to check for cache-control information even if no refresh
Previously, process_head immediately returned if there was no refresh, never giving the cache-control check further down a chance to run.

Also add new tests:

   nocache.html
   refresh+nocache.html
2007-09-04 12:08:08 +00:00
Miciah Dashiel Butler Masters
34c9389e9b Display cache mode in the cache manager's info box for cache entries 2007-09-04 11:54:18 +00:00
Kalle Olavi Niemitalo
cdf2d8181c More missing va_ends.
Somehow, these slipped from commit
af14d00d17 yesterday.
2007-09-04 10:26:57 +03:00
Kalle Olavi Niemitalo
16d4e81f1b Merge commit 'pasky.or.cz/elinks-0.12' into elinks-0.12 2007-09-03 21:04:40 +03:00
Kalle Olavi Niemitalo
c44739e039 Refer to bug 96 in a comment. 2007-09-03 21:02:58 +03:00
Kalle Olavi Niemitalo
a59f44c4b5 Document Unicode characters for ACS_S[1379]. 2007-09-03 21:01:49 +03:00
Kalle Olavi Niemitalo
af14d00d17 Add missing va_ends.
I'm not sure they're needed anywhere nowadays, but still.
2007-09-03 21:01:11 +03:00
Witold Filipczyk
7f49eda39e DOM renderer: off by one error. 2007-09-02 20:44:36 +00:00
Miciah Dashiel Butler Masters
596b9b4d72 Fix compiler warning
Initialise @td to NULL in textarea_edit.  Assert @td in done_textarea_data while we're at it.
2007-09-01 23:46:37 +00:00
Miciah Dashiel Butler Masters
e0f0112de9 Fix -dump with multicell characters 2007-09-01 17:04:58 +00:00
Miciah Dashiel Butler Masters
e1f0c10926 Drop unneeded #include "util/lists.h" from viewer/text/textarea.c 2007-09-01 12:55:02 +00:00
Miciah Dashiel Butler Masters
312a48a24a Merge branch 'master' of ssh://pasky.or.cz/srv/git/elinks 2007-09-01 12:50:57 +00:00
Miciah Dashiel Butler Masters
14af901277 In free_textarea_data, set term->textarea_data to NULL 2007-09-01 12:49:02 +00:00
Miciah Dashiel Butler Masters
92abd48405 Drop EVENT_TEXTAREA, use EVENT_RESIZE instead
When returning from an external program, unblock_itrm_x in the slave process will send a resize event to the master process for the slave terminal.  In handle_interlink_event, when we receive this resize event, we can check whether we need to call textarea_edit.
2007-09-01 12:46:02 +00:00
Miciah Dashiel Butler Masters
a66f6f8c90 Make the textarea_data member of struct terminal opaque
Move the definition of struct textarea_data back to src/viewer/text/textarea.c.
2007-09-01 12:02:21 +00:00
Miciah Dashiel Butler Masters
ac230ebc08 Add free_textarea_data wrapper for done_textarea_data and use in destroy_terminal
Unexport done_textarea_data.
2007-09-01 11:58:29 +00:00
Miciah Dashiel Butler Masters
6469344727 Export done_textarea_data and call in destroy_terminal to prevent leak
Previously, if a terminal crashed with an external editor open, the struct textarea_data would never be freed
2007-09-01 09:45:56 +00:00
Miciah Dashiel Butler Masters
8dc000e313 Set term_->textarea_data = NULL when taking the pointer in textarea_edit 2007-09-01 09:42:54 +00:00
Miciah Dashiel Butler Masters
d384f93522 Factor done_textarea_data out of textarea_edit 2007-09-01 09:24:22 +00:00
Miciah Dashiel Butler Masters
8c5dc2d161 Factor init_textarea_data out of textarea_edit 2007-09-01 09:20:40 +00:00
Miciah Dashiel Butler Masters
cc67edbe1c Drop @textarea_editor global 2007-09-01 09:10:54 +00:00
Miciah Dashiel Butler Masters
d4c262694b Move pointers to struct textarea_data from linked-list to terminal structure 2007-09-01 09:02:01 +00:00
Witold Filipczyk
7726e33b0a bug 181: Simplification. Reverted changes causing incompatibility. 2007-09-01 09:00:36 +00:00
Miciah Dashiel Butler Masters
1000f88748 bug 181: Allow edit textareas using an external editor on slave terminals.
Added EVENT_TEXTAREA used to notify the master terminal
about end of execution of an external program on a slave terminal.
The format of data sent to the master terminal by exec_on_slave_terminal
has changed. Now after 0, fg the value of term is sent.
Therfore this release of ELinks is incompatible with previous releases.

Patch by Witold Filipczyk, taken from his witekfl branch.

Conflicts:

	src/viewer/text/textarea.c
2007-09-01 09:00:33 +00:00
Jonas Fonseca
8489f04cc9 renderer: Fix unnecessary inclusions of document/html/renderer 2007-08-31 15:43:56 +02:00
Jonas Fonseca
5d34b4bff6 Move find_tag to document/document 2007-08-31 15:43:54 +02:00
Miciah Dashiel Butler Masters
69cf0d06e2 get_opt_: only look for a domain-specific option if no session-specific one found 2007-08-31 09:48:58 +00:00
Miciah Dashiel Butler Masters
3dbdde0f8f Fix RSS rendering
Fix inverted boolean logic from commit 8e954e9f61 'rss: check for allocation failure of struct rss_renderer' that totally broke RSS rendering.
2007-08-31 00:08:19 +00:00
Miciah Dashiel Butler Masters
9f6ce80da3 Add config/domain.[ch] (doh!) 2007-08-30 23:36:20 +00:00
Miciah Dashiel Butler Masters
f04bc1c7d1 init_template_by_style: collapse some case statements
After commit b66d2bec67 'document: Unify text style -> screen attribute handling', the case statements for CSS_PT_FONT_WEIGHT, CSS_PT_FONT_STYLE, and CSS_PT_TEXT_DECORATION all have common code and therefore collapse nicely.
2007-08-30 23:31:20 +00:00
Miciah Dashiel Butler Masters
5191ed82a1 Move domain-specific options code to config/domain
For great modularity!
2007-08-30 22:03:14 +00:00
Miciah Dashiel Butler Masters
7f247ec293 Factor get_domain_option_from_session out of get_opt_. 2007-08-30 21:50:55 +00:00
Miciah Dashiel Butler Masters
d9ee9464f4 If it still doesn't work, I'll try compiling it before committing the next attempt. 2007-08-30 21:48:58 +00:00
Miciah Dashiel Butler Masters
7a96a2eda9 Fix a build error from the last change to textarea_edit
Just a silly thinko.
2007-08-30 21:48:03 +00:00
Miciah Dashiel Butler Masters
860d3cc5ef Suppress a warning about an uninitialised value in parse_set_common 2007-08-30 21:42:57 +00:00
Miciah Dashiel Butler Masters
bfe6243bc1 Allow session- or domain-specific settings for document.brose.forms.editor 2007-08-30 21:32:21 +00:00
Miciah Dashiel Butler Masters
0e0bacf0d3 Merge branch 'master' of ssh://pasky.or.cz/srv/git/elinks
Conflicts:

	src/document/options.c
2007-08-30 21:13:43 +00:00
Miciah Dashiel Butler Masters
91947860f2 Check session- and domain-specific settings for many options
Pass the session with some get_opt_* calls.  These are the low-hanging fruit.  Some places will be difficult because we don't have the session or for other reasons.
2007-08-30 21:11:51 +00:00
Miciah Dashiel Butler Masters
360b4ebfee textarea_edit: convert unnecessary checks to assertions
If @op == 0, then @fs_, @doc_view_, @link_, and @term_ should all be set.  Assert them instead of checking them with if statements.
2007-08-30 21:09:14 +00:00
Miciah Dashiel Butler Masters
06adbbc524 Add domain-specific options saving and look-up
Note that this is the infrastructure, but all relevant get_opt_* calls must be changed to pass the session so that the domain-specific options are looked up.

Add @want_domain parameter to parse_set_common and read in the domain-name if the flag is set.

Add parse_set_domain wrapper for parse_set_common.

Add "set_domain" configuration directive with the following syntax: set_domain domain option = value

Modify create_config_string and smart_config_output_fn to spit out domain-specific option trees.

Add @smart_config_output_fn_domain global variable to facilitate this.

Define structure domain_tree and define list @domain_trees.

Add routine get_domain_tree to find or, if necessary, create the shadow tree for the given domain name.

Add routine get_domain_option search for an option in all domain shadow-trees and return the option in the best matching domain tree.

Modify get_opt_ to use get_domain_option to check for domain-specific options.

Add clean-up routine done_domain_trees, called on exit, to free any domain trees.
2007-08-30 21:04:31 +00:00
Miciah Dashiel Butler Masters
5ada24f3ef update_cache_document_options: take @ses and pass it to get_opt calls
change_hook_active_link: pass update_cache_document_options @ses.

Now when changing the global settings, it will not simply copy the new values for the global settings to the document-options cache, but also check session-specific settings.  This doesn't really matter yet, since the options in question can't be set on a per-session basis, but is in preparation for future changes.
2007-08-30 19:19:57 +00:00
Jonas Fonseca
19f3fd686c Compile fix for commit e876df70d8 2007-08-29 20:51:43 +02:00
Miciah Dashiel Butler Masters
f5e6ed4dd7 Drop @options parameter from create_config_string and write_config_file
Hard-code it to config_options.
2007-08-29 13:43:15 +00:00
Miciah Dashiel Butler Masters
d1e16e1066 get_option_shadow: Set OPT_TOUCHED on the new option 2007-08-29 13:34:43 +00:00
Miciah Dashiel Butler Masters
9a5f76dbd5 Move is_in_domain from cookies/cookies.c to protocol/uri.c and export 2007-08-29 13:33:19 +00:00
Miciah Dashiel Butler Masters
7f042a49d7 Factor parse_set_common out of parse_set 2007-08-29 13:30:40 +00:00
Jonas Fonseca
8e954e9f61 rss: check for allocation failure of struct rss_renderer 2007-08-29 12:05:10 +02:00
Jonas Fonseca
6ebcce0655 rss: document the rss_renderer members 2007-08-29 12:02:36 +02:00
Jonas Fonseca
f2db9c07ed rss: remove the horrible text collection code which didn't do anything 2007-08-29 11:27:54 +02:00
Jonas Fonseca
86ffd94237 rss: simplify rendering to be done while parsing 2007-08-29 11:21:06 +02:00
Kalle Olavi Niemitalo
78f733c6c1 More doc comments about coordinates. 2007-08-29 09:57:18 +03:00
Jonas Fonseca
0a5ee2d3de rss: move the rendering code above the push/pop handlers 2007-08-29 02:29:58 +02:00
Jonas Fonseca
51fec0ec52 rss: rename rss_renderer variables from data to rss 2007-08-29 02:26:53 +02:00
Jonas Fonseca
16a4110467 rss: minor cleanups 2007-08-29 02:15:06 +02:00
Jonas Fonseca
19b271e417 rss: remove check for rss_renderer->text that is already done above 2007-08-29 02:13:26 +02:00
Jonas Fonseca
8c4191fe87 rss: assert that node->parent is always set 2007-08-29 02:13:10 +02:00
Jonas Fonseca
af4b7bed84 Use the new OBJS-unless$(CONFIG_FOO) instead of $(call not,...) 2007-08-29 01:57:01 +02:00
Petr Baudis
6b05ddb762 Remove unnecessary document/html/parser.h includes 2007-08-29 00:08:05 +02:00
Petr Baudis
e876df70d8 document/html: Make HTML parser state transparent
Before, *_html_parser_state() operated with struct html_element *. Now, it is
transparent for the renderer (just void *), so that DOM won't have to provide
this struct but will be able to use something internal.
2007-08-28 23:35:00 +02:00
Petr Baudis
e5539a9937 document/html: Move enum html_special_type from parser.h to renderer.h
...since it is renderer interface.
2007-08-28 22:19:33 +02:00
Petr Baudis
a74af825e2 document/dom/rss.c: Add extra styles
Style aux got split to styles author, author-date-sep and date.
2007-08-28 21:34:32 +02:00
Petr Baudis
b457af1984 document/dom/source.c: Trivial simplification 2007-08-28 21:31:49 +02:00
Petr Baudis
baeb0cb0d5 document/dom: Move stylesheet parsing out of style loop
...for better clarity of the document initialization functions.
2007-08-28 21:31:25 +02:00
Petr Baudis
a9619bce80 document/renderer.c: Fix description 2007-08-28 21:28:32 +02:00
Petr Baudis
dc0cf23631 document/dom: Simplify init_template_by_style() usage
It doesn't take the useless styling information but just uses options->default_style.
2007-08-28 21:28:03 +02:00
Petr Baudis
55495ab655 document: Turn options' default_fg, default_bg to default_style
...as struct text_style. This way it might be possible later to
add other default formatting attributes by CSS and it allows
quite a code simplification in the DOM renderer.
2007-08-28 21:16:44 +02:00
Petr Baudis
db9431465f document: Move text_style-related stuff to dedicated format.*
We will need to include it from options.h and the include chain just
wouldn't work. And it feels like a hack to have it in renderer.h anyway.
2007-08-28 21:05:00 +02:00
Petr Baudis
b66d2bec67 document: Unify text style -> screen attribute handling
Currently, all DOM, HTML and plain renderers had their own routine for
conversion from text style to screen attribute. This moves text_style and
text_style_format from html/parser.h to renderer.h and introduces new generic
routine get_screen_chracter_template() that is used by all the specific
rendering engines.
2007-08-28 21:02:08 +02:00
Jonas Fonseca
8376feb6b1 Fix protocol/test ignore rule for the uri-test program 2007-08-28 20:35:14 +02:00
Jonas Fonseca
bbd7c8354a Move get_test_opt to util/test.h and use throughout test programs 2007-08-28 20:34:17 +02:00
Petr Baudis
38ee8a137c document/dom/util.*: Make init_template() private 2007-08-28 20:32:15 +02:00
Jonas Fonseca
c6a223c8dd dom/test: properly test test option matches in get_test_opt 2007-08-28 20:22:29 +02:00
Petr Baudis
070d335796 document: struct format_attr -> struct text_style_format 2007-08-28 20:17:53 +02:00
Jonas Fonseca
5d88ea78f9 dom/test: rename get_opt to get_test_opt to avoid namespace problems 2007-08-28 20:16:27 +02:00
Petr Baudis
e133941206 document/html: struct text_attrib_style -> struct text_style 2007-08-28 20:15:30 +02:00
Jonas Fonseca
0f53941fef Introduce test library in util/test.h containing the die() function
Fix the die() function to exit with EXIT_FAILURE value as pointed
out by Kalle on elinks-dev in <87tzqkxhlp.fsf@Astalo.kon.iki.fi>.
2007-08-28 20:14:08 +02:00
Petr Baudis
46e44f9298 document/dom: Move renderer-specific data from the generic struct dom_renderer
This is hopefully the final step to have the specific renderers completely
separated and self-contained.
2007-08-28 19:58:08 +02:00
Miciah Dashiel Butler Masters
8a8be53452 parse_set and parse_unset: restore stomped char before returning
The parsing in parse_set and parse_unset saves, overwrites with a NUL, and restores a character in the string that is being parsed.  If there is a malloc failure between overwriting and restoring, the restore is not done.  This commit changes that behaviour to restore before returning.
2007-08-28 17:47:59 +00:00
Petr Baudis
91e512cca8 document/dom: Move URL regexp setup from general code to source renderer 2007-08-28 19:40:30 +02:00
Petr Baudis
afb9b6daa5 document/dom: Move styles initialization out of init_dom_renderer()
Now, CSS is initialized separately for each of the renderers, so that
also RSS doesn't just choose styles of random DOM node types.

init_template_by_style() is introduced as the common backend for
loading CSS properties.
2007-08-28 19:38:13 +02:00
Miciah Dashiel Butler Masters
fa12b10e26 Introduce session- (tab-)specific options
Introduce session-specific options for those options that have toggle-... actions.
2007-08-28 17:29:41 +00:00
Miciah Dashiel Butler Masters
fd22173b29 Introduce option tree shadowing
Introduce get_option_shadow.  This routine takes an option, the tree under which that option resides, and another tree.  It returns a corresponding option with parallel ancestry in the second tree, creating that option and ancestry if it does not already exist.

Add enum copy_option_flags.

Add the CO_NO_LISTBOX_ITEM flag, which is used to suppress listbox creation for shadowed trees.

Add the CO_SHALLOW flag, which is used to suppress the duplication of unwanted children for shadowed trees.

Add a flags parameter to copy_option and tree_dup (and out of necessity, struct option_type_info and str_dup).
2007-08-28 17:25:24 +00:00
Miciah Dashiel Butler Masters
ea372bd0cd get_opt_*: Add ses parameter
Add a session parameter to get_opt_ and its wrappers in preparation for session-specific and domain-specific options.
2007-08-28 17:24:59 +00:00
Petr Baudis
494e4a1019 document/dom/rss.c: Explain what normalizing is
As insighted by Jonas.
2007-08-28 18:12:41 +02:00
Petr Baudis
2480d1ae0a Merge branch 'master' of /srv/git/elinks 2007-08-28 17:43:14 +02:00
Petr Baudis
445a0ae600 document/dom: Some symbols should be static 2007-08-28 17:43:01 +02:00
Petr Baudis
4003e6decf document/dom: Split SGML (HTML) source renderer to source.* 2007-08-28 17:41:55 +02:00
Petr Baudis
556ae45b00 document/dom: Split RSS renderer to rss.* 2007-08-28 17:33:22 +02:00
Petr Baudis
144bd77240 document/dom: Split rendering utilities to util.*
These are functions that are commonly used by the individual renderers to put stuff on the canvas etc.
2007-08-28 17:12:23 +02:00
Miciah Dashiel Butler Masters
3975d28bce Merge commit 'origin/elinks-0.12'
Conflicts:

	doc/Doxyfile.in
	src/protocol/bittorrent/common.h
2007-08-28 14:47:39 +00:00
Miciah Dashiel Butler Masters
80259bc53e Revert "justify_line(): Re-add wordlen == 0 test"
This reverts commit 18cdce6c39.

elinks-0.12 has a different fix, and I will soon merge in that branch.
2007-08-28 13:41:14 +00:00
Petr Baudis
f88f49d955 document/dom: Explain that only renderer lives here 2007-08-28 15:15:13 +02:00
Kalle Olavi Niemitalo
40afaae7d6 Doc comments about coordinate systems.
So that I may better understand Witek's patches.
2007-08-28 09:52:37 +03:00
Petr Baudis
18cdce6c39 justify_line(): Re-add wordlen == 0 test
This fixes ELinks crashing on this with terminal width e.g. 103:

	<p align="justify">
	xxxx xxxx xxxx xxxxx xxxxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx
	xxxxx xxxx xxxxxxx xxx xxxxxxx xxx xxxx xxxx xxxx xx xxxx x xxx xxxx
	xxxx xx xxxx xxxx xxxx xxx&mdash;xxx xxxx xx&mdash;xxx xxxx<em> </em>x
	xxxx </p>

This test was removed for an unknown reason in commit
b1cc717789.

Discovered together with Miciah.
2007-08-26 19:06:26 +02:00
Miciah Dashiel Butler Masters
1fd2a77416 Update comment: html_form_control -> html_special_form_control
Update a comment in encode_multipart, which refers to html_form_control, which has since been renamed to html_special_form_control.

The comment was added with this commit:

   commit b4dee890a61a6c8a27a8e4cd1dc3b3b93f1cdb08
   Author: Petr Baudis <pasky@ucw.cz>
   Date:   Fri May 10 13:26:55 2002 +0000

       Don't decode and back encode hidden form items (by mikulas, from 0.97).

The function was renamed with this commit:

   commit c9d72739c715b3b0c7c6fec582780c1e8f444fc4
   Author: Petr Baudis <pasky@ucw.cz>
   Date:   Sat Dec 18 02:22:28 2004 +0000

       html_(tag|form*) -> html_special_\1, to naming prevent conflicts with HTML element handlers. As suggested by Jonas.
2007-08-12 11:23:49 +00:00
Jonas Fonseca
5f18156708 Change protocol/test to use the shell-based test infrastructure 2007-08-10 13:30:28 +02:00
Jonas Fonseca
b3ca6a9e1f Add rule to make (c)tags file
Also fix (e)TAGS rule to work when srcdir == builddir and
Remove the tag files during clean.
2007-08-10 10:26:14 +02:00
Jonas Fonseca
36f59cacd6 Ignore tags file 2007-08-08 14:25:38 +02:00
Jonas Fonseca
d083619988 Fix doxygen warning about list end marker 2007-08-08 14:24:55 +02:00
Jonas Fonseca
1079c95b9d Integrate Doxygen better in the build system
This change:

 - Adds a check for the doxygen program to configure.
 - Moves the Doxyfile from src/Doxyfile to doc/Doxyfile.in.
 - Generates a doc/Doxyfile from doc/Doxyfile.in inserting
   an absolute path to the source directory, so that it
   also works when builddir != srcdir.
 - Adds `make api` rule for running doxygen; it depends on
   api/doxygen file which is never created to force the rule
   to always run.
2007-08-08 14:23:21 +02:00
Jonas Fonseca
4e710a3aa6 Doxygenate main header files of src/protocol/bittorrent 2007-08-08 13:20:26 +02:00
Jonas Fonseca
ab5e7f116b Update hierbox comments and make them ready for Doxygen
Noticed by kon.
2007-08-08 13:18:53 +02:00
Jonas Fonseca
fd9f1f8f6d Doxify bfu/style
Also fixes an old misleading comment noticed by kon.
2007-07-31 14:39:12 +02:00
Jonas Fonseca
b831ee64aa Fix dom_node_attribute comment mentioning non-existant struct
Noticed by kon.
2007-07-31 14:37:41 +02:00
Kalle Olavi Niemitalo
dc2cac851d itrm: Don't mention bug 776 which was already fixed. 2007-07-31 14:14:08 +03:00
Kalle Olavi Niemitalo
cc813e8541 Doxygen: minor changes in src/terminal/itrm.h 2007-07-31 14:12:28 +03:00
Kalle Olavi Niemitalo
870df797cf Doxygen: Escape some HTML tags. 2007-07-31 13:48:20 +03:00
Kalle Olavi Niemitalo
76c6f38169 Doxygen: Begin commands with @ not \. 2007-07-31 13:47:12 +03:00
Kalle Olavi Niemitalo
0cb047b298 Bug 968: Don't use copy_chars in justify_line.
All the needed memory has been allocated before the loop so we can use
copy_screen_chars() directly.  This avoids the assertion failure in
copy_chars() for width==0 and should be a bit faster too.  According
to ISO/IEC 9899:1999 7.21.1p2, memcpy() doesn't copy anything if n==0
(but the pointers must be valid).
(original 'git cherry-pick' arguments: cherry-pick bug968-att394)
2007-07-30 16:43:46 +03:00
Kalle Olavi Niemitalo
fd902e81da Rewrite wiki to en.wikipedia.org, avoid server bug.
<http://www.wikipedia.org/w/wiki.phtml?search=sue%20lawley>
incorrectly redirects to
<http://en.wikipedia.org/w/wiki.phtml?search=sue%2520lawley>
which searches for "sue%20lawley" rather than "sue lawley".
By using en.wikipedia.org directly, we avoid the server bug.
Prompted by an elinks-users post on 2007-07-27.

I asked on #wikimedia-tech, and www.wikipedia.org does always
redirect to en.wikipedia.org; it does not guess any other
language based on headers or IP addresses or such.  Also, the
redirection exists only for compatibility, and skipping it
avoids a few roundtrips to the server.  So this change is good
even if the server is eventually fixed.
2007-07-30 15:07:20 +03:00
Kalle Olavi Niemitalo
bf63228e56 Doxygen: Define CONFIG_ECMASCRIPT and CONFIG_ECMASCRIPT_SEE. 2007-07-29 19:45:55 +03:00
Kalle Olavi Niemitalo
21052fafb0 Doxygen: more links in terminal/screen.c 2007-07-29 13:02:02 +03:00
Kalle Olavi Niemitalo
6311a9d7a6 TAGS: recognize static INIT_LIST_OF 2007-07-29 12:55:38 +03:00
Kalle Olavi Niemitalo
778996d725 Doxygen: expand INIT_LIST_OF 2007-07-29 12:55:25 +03:00