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.
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)
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)
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.
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)
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)
The older help2doc script is no longer used for anything.
To make future cherry-picking easier, this commit does not include the
resulting changes in generated files.
The intention is to convert --config-help and --long-help outputs to
DocBook XML and XHTML rather than AsciiDoc, so that the converter does
not have to work around the intricate AsciiDoc syntax. However, this
commit does not yet connect the script to doc/Makefile.
XHTML could be generated from DocBook XML, but the script outputs it
directly because our DocBook is primarily intended for manual pages
and so does not have all the links that are useful in HTML.
*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)
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.
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.
The primary motivation for this change is that the disclaimer now
refers to the author whereas it used to refer to the copyright holder.
The ISC license is the preferred license for new code in OpenBSD.
http://www.openbsd.org/policy.htmlhttp://www.openbsd.org/cgi-bin/cvsweb/src/share/misc/license.template?rev=1.2
I am also removing the reference to "the same terms as Perl itself"
because those terms are not being distributed with ELinks. Anyway,
Perl 5 is dual licensed under the Artistic License and the GNU General
Public License (version 1 or later), and the ISC license seems GPL
compatible to me.
Without this, "make --directory=doc V=1 keymap-defaults.txt"
would not display the command it runs, because the command is
LC_ALL=C LANGUAGE=en /home/Kalle/src/elinks-0.12/doc/tools/keys2doc /home/Kalle/src/elinks-0.12/src/config/kbdbind.c keymap-defaults.txt > keymap-defaults.txt
and the build system would run
echo LC_ALL=C LANGUAGE=en /home/Kalle/src/elinks-0.12/doc/tools/keys2doc /home/Kalle/src/elinks-0.12/src/config/kbdbind.c keymap-defaults.txt > keymap-defaults.txt && LC_ALL=C LANGUAGE=en /home/Kalle/src/elinks-0.12/doc/tools/keys2doc /home/Kalle/src/elinks-0.12/src/config/kbdbind.c keymap-defaults.txt > keymap-defaults.txt
so, the initial echo was redirected to keymap-defaults.txt too,
and then overwritten with the intended output. Now, the build
system instead runs
echo 'LC_ALL=C LANGUAGE=en /home/Kalle/src/elinks-0.12/doc/tools/keys2doc /home/Kalle/src/elinks-0.12/src/config/kbdbind.c keymap-defaults.txt > keymap-defaults.txt' && LC_ALL=C LANGUAGE=en /home/Kalle/src/elinks-0.12/doc/tools/keys2doc /home/Kalle/src/elinks-0.12/src/config/kbdbind.c keymap-defaults.txt > keymap-defaults.txt
which echoes the redirection instead of executing it. This change
also makes the output correctly preserve quotes in some other rules.
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.
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.
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.
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.)
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=90483http://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.)
This version takes about 1/300 of the time of the shell version
and fixes several errors in the output, most importantly that
option descriptions were being truncated at the first empty line.
Because help2doc is run only from make update-man, and the distributed
tarballs include prebuilt man pages, people building ELinks need not
have Perl installed.
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)
This adopts customized docbook manpage header from git's
Documentation/asciidoc.conf and does away with a couple of
ugly hacks.
(cherry picked from commit 0ecc8b9d60,
omitting generated files)
In set and unset commands, the <option> must not be quoted. In the
sample protocol.user.mailto.unix setting, the internal quotes were
using some manpage syntax, resulting in incorrect HTML output.