1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-29 01:45:34 +00:00
Commit Graph

3258 Commits

Author SHA1 Message Date
Kalle Olavi Niemitalo
7314a77731 NEWS: Bug 1080 does not apply to elinks-0.11. 2009-07-07 14:30:29 +03:00
Kalle Olavi Niemitalo
ce5afcad7b NEWS and AUTHORS for the previous change 2009-06-29 23:39:40 +03:00
Yuriy M. Kaminskiy
e5f4c59a20 Fixes failure to search for more than one double-width character. 2009-06-29 23:33:28 +03:00
Kalle Olavi Niemitalo
e452420d5f Debian bug 534835: Don't assert ecmascript_reset_state succeeds
After the recent ecmascript_get_interpreter change, I got an assertion
failure in render_document, which calls ecmascript_reset_state and
then asserts that it has set vs->ecmascript != NULL.
ecmascript_reset_state cannot guarantee that because there might not
even be enough free memory for mem_calloc(1, sizeof(struct
ecmascript_interpreter).  So, replace the assertion in render_document
with error handling, and likewise in call_onsubmit_and_submit.
2009-06-28 11:17:06 +03:00
Kalle Olavi Niemitalo
11c0cb859b Debian bug 534835: Check *_get_interpreter return values
This should fix a crash in:

    at /home/Kalle/src/elinks-0.12/src/ecmascript/spidermonkey.c:251
    at /home/Kalle/src/elinks-0.12/src/ecmascript/ecmascript.c:104
    at /home/Kalle/src/elinks-0.12/src/viewer/text/vs.c:64

It seems that spidermonkey_get_interpreter failed and returned NULL to
ecmascript_get_interpreter, which did not check the return value and
behaved as if the ECMAScript interpreter had been properly initialized.
This caused destroy_vs to call ecmascript_put_interpreter, but
backend_data which should have been a JSContext * was NULL, causing
a crash in SpiderMonkey.

An alternative fix might be to make spidermonkey_put_interpreter skip
the JS_DestroyContext call if ctx is NULL.  However, I think it is
better to make sure ecmascript_get_interpreter returns NULL if
spidermonkey_get_interpreter fails, so that vs->ecmascript is left
NULL and there's no chance that some other code might try to
dereference the (JSContext *) NULL.
2009-06-28 00:18:05 +03:00
Kalle Olavi Niemitalo
10c07f9933 Debian bug 534835: Check some SpiderMonkey return values
Perhaps because of bug 981, if one opened hundreds of pages with
elinks --remote openURL(...), then ELinks 0.11.4 could crash with a
SIGSEGV in JS_InitClass called from spidermonkey_get_interpreter.
SpiderMonkey ran out of memory and began returning NULL and JS_FALSE
but ELinks didn't notice them and pressed on.  Add some checks to
avoid the crash, although the underlying out-of-memory error remains.
2009-06-27 19:48:56 +03:00
Kalle Olavi Niemitalo
645e9f22fe dump: Trim spaces only in color mode 0 or -1
The old code failed to write pending spaces before changing the
background color.  That seems hard to fix without duplicating code,
and ELinks pads dumped lines to the requested width in these color
modes anyway, so this commit just makes ELinks write all spaces
immediately when colors are being used.

Try the following command before and after this commit:
elinks --no-home --eval "set document.colors.use_document_colors = 2" \
--dump-color-mode 1 --dump test/color.html
2009-06-21 19:35:50 +03:00
Kalle Olavi Niemitalo
9bc79e4ecf dump: Define DUMP_COLOR_MODE_NONE 2009-06-21 19:35:50 +03:00
Kalle Olavi Niemitalo
773549180d dump: Use dump functions in add_document_to_string
Now that struct dump_output supports appending to a string,
add_document_to_string() can just use that feature, instead of
duplicating the code.
2009-06-21 19:35:50 +03:00
Kalle Olavi Niemitalo
f64463a780 dump: Let struct dump_output append to a string
struct dump_output can now be initialized in such a way that data
written to it will be appended to a struct string.  Nothing uses this
feature yet.
2009-06-21 19:35:50 +03:00
Kalle Olavi Niemitalo
04dabd5bf1 dump: Move the buffer into new struct dump_output 2009-06-21 19:35:49 +03:00
Kalle Olavi Niemitalo
2f0cefffb5 dump: Replace control characters with spaces
In DUMP_FUNCTION_SPECIALIZED, use isscreensafe_ucs (for UTF-8) or
isscreensafe (for unibyte) to detect control characters, and replace
them with spaces.  add_document_to_string already did the same.
2009-06-21 19:35:49 +03:00
Kalle Olavi Niemitalo
ee182ced2b dump: Unify detection of fullwidth characters
In DUMP_FUNCTION_SPECIALIZED (used by elinks --dump), detect the
second cell of double-cell (aka fullwidth) characters by comparing to
UCS_NO_CHAR, like add_document_to_string does.  Don't use
unicode_to_cell for this any more.

Also, ignore the colors and attributes of the second cell; don't
output any escape sequences for them.
2009-06-21 19:35:49 +03:00
Kalle Olavi Niemitalo
f0c88e1960 dump: One #if for declarations and another for statements 2009-06-21 19:35:49 +03:00
Kalle Olavi Niemitalo
417dcba57f dump: Rename result variables to error
Because 0 in them means OK and nonzero (currently -1) means an error.
2009-06-19 12:48:55 +03:00
Kalle Olavi Niemitalo
4f29067169 bug 1081: Fix regfree crashes by changing order of libraries 2009-06-12 23:14:45 +03:00
Kalle Olavi Niemitalo
dedd01c970 dump: More const
This is especially useful for showing that neither dump_truecolor_utf8
nor dump_truecolor_unibyte modifies its static color[] variable and it
therefore does not matter whether those functions use the same array
or not.
2009-06-09 03:48:40 +03:00
Kalle Olavi Niemitalo
bdcbb9f667 dump: Move local variable to reduce nesting 2009-06-09 03:39:23 +03:00
Kalle Olavi Niemitalo
79ea8d087d dump: Elide trailing spaces in UTF-8 mode too 2009-06-09 03:39:17 +03:00
Kalle Olavi Niemitalo
20dfdb284f bug 1080: Mention in NEWS 2009-06-09 01:21:08 +03:00
Kalle Olavi Niemitalo
952c6fa8aa bug 1080: Fold UTF-8 and unibyte dumping together
With all the comments and macros needed for this, the source files
don't become much shorter, but anyway I hope they'll be easier to
maintain this way.
2009-06-09 01:17:06 +03:00
Kalle Olavi Niemitalo
596a7cbd9b bug 1080: Implement color modes for UTF-8 dumping 2009-06-09 00:07:38 +03:00
Kalle Olavi Niemitalo
35a091e8f0 bug 1080: Move common code to dump_references()
This code was included in four variants of dump_to_file().
Move it to a new function dump_references() and make dump_to_file()
then call that.  This makes the code size a little smaller.
The time cost will be negligible.
2009-06-09 00:07:38 +03:00
Kalle Olavi Niemitalo
200e36c002 bug 1080: Fold dump_color_mode* functions together
Instead of having four separate function definitions, have just one
sprinkled with #ifdefs, and #include that four times.  The purpose
being to make it clearer which parts of these functions are identical
and which ones differ.

As a side effect, this change makes ELinks ignore --dump-color-mode
when dumping in UTF-8.  Colourful UTF-8 dumping has not been
implemented and the fallback is now different from before.
2009-06-09 00:06:10 +03:00
Kalle Olavi Niemitalo
da4bd42e43 bug 1017: Disable protocol.http.compression by default
To work around buggy servers until bug 1017 has actually been fixed,
i.e., ELinks reports decompression errors to the user.
2009-06-07 12:49:41 +03:00
Kalle Olavi Niemitalo
7ae20dc0c2 NEWS: Don't refer to 0.11.6.GIT from 0.12pre4
ELinks 0.12pre4 has already been released and will not be modified.
Eventually, new changes will be made in ELinks 0.11.6.GIT and then
listed in this file.  At that time, it would be wrong to claim that
0.12pre4 also includes the changes.
2009-06-07 11:47:53 +03:00
Kalle Olavi Niemitalo
87e88df268 mkdist: Don't create a .git directory.
That was a remnant from the time when mkdist created a .git/HEAD
referring to the commit from which the distribution was made.
Nowadays, it creates git-commit-id instead.
2009-06-03 10:55:18 +03:00
Kalle Olavi Niemitalo
17f2cea4cc French translation authorship info
Remove the Language-Team header; Zas is a person, not a team.

Copyright licence was given in email:

Date: Tue, 2 Jun 2009 09:49:16 +0200
From: Mikael Berthe <mikael.berthe@lilotux.net>
To: Kalle Olavi Niemitalo <kon@iki.fi>
Cc: Laurent Monin <i18n@norz.org>
Subject: Re: [ELinks] French translation update
Message-ID: <20090602074916.GX5189@lilotux.net>

Date: Tue, 2 Jun 2009 10:30:50 +0200
From: Mikael Berthe <mikael.berthe@lilotux.net>
To: Kalle Olavi Niemitalo <kon@iki.fi>
Subject: Re: [ELinks] French translation update
Message-ID: <20090602083050.GY5189@lilotux.net>
(cherry picked from commit 50fb6d45f3)
2009-06-03 09:52:03 +03:00
Mikael Berthe
29227fe6f8 French translation update
(cherry picked from commit 1698deab07)

Conflicts:

	po/fr.po
2009-06-03 09:50:11 +03:00
Kalle Olavi Niemitalo
cde4a2f7b3 NEWS: ELinks 0.12pre4 released on 2009-05-31 2009-05-31 12:32:13 +03:00
Kalle Olavi Niemitalo
c15a337529 ELinks 0.12pre4.GIT 2009-05-31 12:17:55 +03:00
Kalle Olavi Niemitalo
a23a49fb4e ELinks 0.12pre4 2009-05-31 11:48:47 +03:00
Kalle Olavi Niemitalo
e82466f90f NEWS: ELinks 0.12pre4 2009-05-31 11:23:46 +03:00
Kalle Olavi Niemitalo
faa274b31a NEWS: Bug 1071 was not in 0.11.5
Also, 0.11.5 supports parsing RSS, although not rendering it.
2009-05-31 11:18:03 +03:00
Kalle Olavi Niemitalo
9e3762e01c gpm-wheel.patch is not needed in 1.20.3pre5 and later 2009-05-31 10:57:46 +03:00
Kalle Olavi Niemitalo
f779054f05 NEWS: bug 765 has been fixed 2009-05-30 15:27:18 +03:00
Kalle Olavi Niemitalo
681e377027 Debian bug 528661: Check for gnutls_priority_set_direct
Avoid compilation error with GNUTLS 1.2.9:

/home/Kalle/src/elinks-0.12/src/network/ssl/ssl.c:258: error: implicit declaration of function ‘gnutls_priority_set_direct’

If the function is not available, use gnutls_set_default_priority instead.
Perhaps it'll work with bugzilla.novell.com, perhaps not.
2009-05-30 14:34:01 +03:00
Witold Filipczyk
864fa0b56a Debian bug 528661: Disable some TLS extensions on GNUTLS.
- gnutls_handshake_set_private_extensions: Do not enable private cipher
  suites that might not be supported by anything other than GNUTLS.
  The GNUTLS 2.8.0 documentation notes that enabling these extensions
  can cause interoperability problems.
- gnutls_set_default_priority: Explicitly disable OpenPGP certificates.
- gnutls_certificate_type_set_priority: Do not enable OpenPGP certificates.
  The GNUTLS 2.8.0 documentation notes that OpenPGP certificate support
  requires libgnutls-extra.  Because libgnutls-extra 2.2.0 and later are
  under GPLv3-or-later and thus not GPLv2 compatible, ELinks doesn't use
  libgnutls-extra, so OpenPGP certificates didn't work anyway.
- gnutls_server_name_set: Do not tell the server the hostname from the URL.
  This was supposed to let the server choose the appropriate certificate
  for each name-based virtual host, but ELinks actually always sent just
  "localhost", so it didn't work anyway.  This will have to be revisited
  when ELinks is changed to actually verify the subject name from the
  server's certificate (ELinks bug 1024).

These changes should help ELinks negotiate SSL with bugzilla.novell.com.

[NEWS and commit message by me.  --KON]
2009-05-30 11:21:17 +03:00
Miciah Dashiel Butler Masters
1eebbb9ede Bug 765: use ses_load to load old tab's document
Yet another valiant wack at the beast.  This one violates abstractions
a little less deeply, so maybe it will work better.

The last attempt caused a crash when a tab was cloned after the tab's
loading had been aborted.
(cherry picked from commit 76377d9714)
2009-05-27 22:15:23 +03:00
Miciah Dashiel Butler Masters
f5103d0cc0 Bug 765: use load_uri to load old tab's document
Kalle reported that after commit 5c96d430c9,
ELinks would crash if the document in the old tab was still loading when a
new tab was opened.  The problem was that the new session's download.data
pointer was not updated to point to the session as doc_loading_callback
expects.

Instead of just calling render_document_frames, set up the download and
call load_uri.
(cherry picked from commit d6116ca83a)
2009-05-27 22:14:19 +03:00
Miciah Dashiel Butler Masters
f4a231cb9a 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.

(cherry picked from commit 5c96d430c9)

Conflicts:

	src/session/session.c:
		Both elinks-0.12 and master had the ses->doc_view->vs
		= vs assignment, but only elinks-0.12 had vs->doc_view
		= ses->doc_view as well.  Also, struct connection_state
		had been added after the original patch.
2009-05-27 22:05:22 +03:00
Kalle Olavi Niemitalo
b6aca8d9a7 Add tests for utf8_step_forward
I am not hooking these to "make test", for two reasons:

1. utf8_step_forward is inside #ifdef CONFIG_UTF8 and I don't see
   how to make tests conditional on such options.

2. test/libtest.sh was copied from Git, which is under GPLv2-only.
   Adding more dependencies on it could make ELinks more difficult
   to relicense under GPLv2-or-later.
2009-05-27 01:11:03 +03:00
Kalle Olavi Niemitalo
5aae1b81cc Define die() with __attribute__((noreturn))
This will prevent some compiler warnings in the test I'm about to
commit.
2009-05-27 01:11:03 +03:00
Kalle Olavi Niemitalo
6d7b904fe3 Don't overcount in utf8_step_forward
Reported by witekfl.
2009-05-27 01:11:02 +03:00
Witold Filipczyk
68ccb4513d bug 765: If set download->callback set also download->data.
In the task.c line 517 there is:
	if (is_in_progress_state((*download_p)->state)) {
		if (have_location(ses))
			*download_p = &cur_loc(ses)->download;
			^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Here the download was changed. download->data and download->callback
were NULL after the assignment, but later in loading_callback
only download->callback had new value. download->data was still NULL.
2009-05-27 01:11:02 +03:00
Kalle Olavi Niemitalo
3d4919507a configure: More extensible choice of SSL library
In 0.13.GIT, the configure script sets disable_gnutls=yes if it
decides to use nss_compat_ossl.  In recent elinks-0.12, the script
logs "explicitly disabled" if $disable_gnutls is set.  Thus, merging
those together could have caused an incorrect claim to be logged.

Rearrange the logic to make it easier to extend to multiple libraries.
Code that deals with one library no longer needs to worry about each
alternative library separately.  Instead just test and set the one
shared chosen_ssl_library variable.

While at it, get rid of openssl_withval, which merely mirrored the
with_openssl variable provided by Autoconf.
2009-05-23 10:48:16 +03:00
Kalle Olavi Niemitalo
a7fe06be06 Debian bug 529821: Mention loss of --with-gnutls=DIR in NEWS 2009-05-23 10:48:16 +03:00
Kalle Olavi Niemitalo
bd87e0915e Mention pkg-config dependency in doc/installation.txt 2009-05-22 22:53:06 +03:00
Kalle Olavi Niemitalo
f8bbf1a227 Debian bug 529821: Use pkg-config, not libgnutls-config
The configure script used to run libgnutls-config in order to find the
compiler and linker options needed for using GNUTLS, but GNUTLS 2.7
apparently doesn't ship that script any more.  Use pkg-config instead.
GNUTLS 1.2.0 is the oldest version supported by ELinks, and that already
installs the gnutls.pc file required by pkg-config.

This commit also removes support for configure --with-gnutls=DIR.
The configure script used to look for libgnutls-config in DIR.
DIR thus had to be a directory where executable programs were installed,
and it's unlikely that gnutls.pc would be found there.  So, any callers
that used this feature would have to be changed anyway, and they can as
well be changed to set the PKG_CONFIG_PATH environment variable instead.
2009-05-22 22:53:06 +03:00
Kalle Olavi Niemitalo
feb640f29c configure: Cosmetic changes in C99 inline check 2009-05-22 22:53:06 +03:00