1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00
Commit Graph

3945 Commits

Author SHA1 Message Date
Witold Filipczyk
7453b03279 deflate switched on again.
askubuntu.com uses deflate compression.
2014-09-01 12:50:23 +02:00
Witold Filipczyk
e7ebfa06c3 deflate is broken. 2014-09-01 12:19:49 +02:00
Bin Guo
7553d321a1 Fixed problem of converting more thant 256 chars. 2014-06-26 21:21:59 +02:00
Aaro Koskinen
e6c0f0a253 configure.in: use PKG_CONFIG
Don't hardcode pkg-config, this will make cross-compilation easier.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
2014-03-08 14:15:07 +01:00
Fabienne Ducroquet
3379fc988c Respect alphabetical order for the actions
I didn’t respect the right order when I added the functions to move up and down
by half a page a few years ago.

Signed-off-by: Fabienne Ducroquet <fabiduc@gmail.com>
2013-12-18 16:38:57 +01:00
Fabienne Ducroquet
5a34763b39 elinks.conf.5, elinkskeys.5: Document undocumented features
I should have done that when I added them, mea culpa.

Signed-off-by: Fabienne Ducroquet <fabiduc@gmail.com>
2013-12-18 15:33:27 +01:00
Fabienne Ducroquet
60a5fce0f0 Add a function to put the current line at the top of the screen
Signed-off-by: Fabienne Ducroquet <fabiduc@gmail.com>
2013-12-18 10:01:34 +01:00
Witold Filipczyk
40fdc14012 30 instead of 10. Python tutorial looks better. 2013-12-16 17:04:59 +01:00
Kamil Dudka
a375110703 configure.in: add a missing AC_LANG_PROGRAM macro
... around the first argument of AC_COMPILE_IFELSE in order to eliminate
warnings with autoconf 2.68.
2013-09-18 15:35:11 +02:00
Fabienne Ducroquet
b2bc6f5049 Add support for the CSS list-style-type property
Use the same functions as for the list-style property since only the "type" part
of the list-style property is supported at this stage.

Signed-off-by: Fabienne Ducroquet <fabiduc@gmail.com>
2013-09-07 10:52:01 +02:00
Fabienne Ducroquet
ad7ff0386d Changes in the handling of the format flags for list elements
* Rename P_STAR as P_DISC and P_PLUS as P_SQUARE.

* Delete P_NONE because it was used only as the default flag in init_html_parser
  and a list with P_NONE then got bullets, so instead use P_DISC by default (as
  per the CSS specification), and P_NO_BULLET for lists with no bullets.

* Use as bullets the characters:
  - U+25E6 WHITE BULLET for the circle style;
  - U+25AA BLACK SMALL SQUARE (alias square bullet) for the square style;
  - U+2022 BULLET for the disc style (default).

Signed-off-by: Fabienne Ducroquet <fabiduc@gmail.com>
2013-09-07 10:51:54 +02:00
M. Levinson
a229adb19a A more nuanced approach to Python warnings.
By default some Python warning messages would be written to standard error
by the interpreter. To prevent these warnings from making a mess of the
ELinks screen, all warnings were turned into exceptions so they could be
caught and displayed through the usual report_scripting_error() mechanism.

With Python 3.2, this approach backfires: A new class of ResourceWarnings
that are filtered by default (and hence would *not* have been written to
standard error) are now turned into exceptions, and these exceptions can't
be caught because they're emitted from the interpreter's cleanup code. As
a result, the uncaught exceptions would make a mess of the ELinks screen.

The new solution is to replace Python's standard library function
warnings.showwarning() with one that turns warning messages into exceptions.
This means we'll wait until a warning would have been written to standard
error before turning it into an exception, so other warnings that would
never have reached that point because they're filtered will remain unseen.

(The behavior of warning messages is described in the documentation for
the "warnings" module from Python's standard library.)
2013-07-05 12:29:58 +02:00
witekfl
91515990c8 Removed --with-gc and CONFIG_GC related code.
CONFIG_GC was added with SEE, but SEE support was removed, so
I don't see the reason to keep gc.
2013-05-14 15:36:32 +02:00
witekfl
7dd4d9b737 iconv: Bail out of the loop when an illegal sequence of bytes occurs.
Before, with the default codepage GB2312 and a mysql sql dump in UTF-8
I got segfaults in the iconv related code.
2013-02-27 09:33:55 +01:00
Techlive Zheng
0ba951021a Elinks currently only support GB2312 as Chinese encoding, but GBK and
GB18030 are also widely used. Codepage CP936 is almost identical to
GBK, so I add it as an alias.
2013-01-20 12:58:03 +01:00
witekfl
26e41cb6c3 Redefine FD_SETSIZE on Windows. Set it to 4096.
There was hardcoded 4096 for threads size, but below there was:
	assertm(fd >= 0 && fd < FD_SETSIZE,
		"get_handler: handle %d >= FD_SETSIZE %d",
		fd, FD_SETSIZE);
	if_assert_failed return NULL;
which fails for fd > 1024 (1024 was previous value of FD_SETSIZE)
2013-01-05 13:42:35 +01:00
witekfl
4fc6343407 mem_free_if(data) instead of if (data) mem_free(data). Shorter. 2013-01-04 17:54:57 +01:00
witekfl
b0ea7cd7c1 decompress_data is now cleaner, isn't it? 2013-01-04 16:23:09 +01:00
witekfl
6fae43511c Call decompress_data only for compressed data.
Hope this is less missleading than before.
2013-01-04 16:00:50 +01:00
Kalle Olavi Niemitalo
642e164ec3 rewrite: update default dumb and smart prefixes
DELETED:

* dumb {b}, smart {bb, bb_fr_en, bb_en_fr}: Redirects to Microsoft
  Translator, which I can't get to work without JavaScript.  Deleted.

* dumb {pyhelp}, smart {py, pydev}: Deleted as recommended by the
  author of the CGI script.

* dumb {pyvault, lyrics}, smart {pyvault}: Can't find a new URL for the
  service.  Deleted.

* smart {gd}: Google Directory has been shut down.  Deleted.

* smart {sd, sdc, sdu, sdp, sdj, whatis}: These don't seem to work
  without JavaScript.  Deleted.

* smart {id, draft}: The search still exists but I can't get it to
  take the words from the URL.  Deleted.

UPDATED:

* dumb {cia}: Had changed its URL, and the service is down, but they
  intend to restore it.  Updated and kept.

* dumb {lua}: ELinks no longer supports Lua 4.0.  Changed to 5.1 as
  installed by Debian.

* smart {cliki, foldoc, gwho, gwhat, gwhere, gwhen, a, imdb, wn, fsd,
  rfcs, cr}: Updated URLs.
2012-11-30 09:24:53 +02:00
Kalle Olavi Niemitalo
268249c50b SMJS: move comments to match spidermonkeyFunctionSpec[]
Each C function that can be called as a method of an ECMAScript object
is typically listed in a spidermonkeyFunctionSpec array and has a
comment that shows the name of the array and the name of the method.
For example, elinks_alert has a comment /* @elinks_funcs{"alert"} */
because elinks_funcs[] contains an element { "alert", elinks_alert, 1 }.

When some of those functions were split into outer and inner functions
for SpiderMonkey 1.8.5 compatibility, the comments were attached to
the inner functions, which contain the bulk of the code.  Move the
comments to the outer functions, to which the array elements point.
2012-11-26 00:15:09 +02:00
Kalle Olavi Niemitalo
c4a23543fd SMJS: verbose comment about JS_AddNamedStringRoot 2012-11-25 21:06:09 +02:00
witekfl
767a1c4228 bug 1126: use draw_text for titles
I didn't check big dialog boxes.
2012-11-19 14:24:34 +01:00
Kalle Olavi Niemitalo
d3022aa7be SMJS bookmark_set_property: Don't use JS_ValueToId.
Partially revert commits
a1c5fe51 (2011-05-08) bookmark_folder_get_property: xulrunner-2.0 fix
e86ec567 (2012-03-04) Compilation fixes (--enable-debug)

jsval_to_bookmark_string once again takes jsval val, rather than jsid id.
This way, bookmark_set_property does not have to call JS_ValueToId,
which would needlessly intern the new string value of the property,
i.e. the title or the URI.  Instead, bookmark_folder_get_property
has to call JS_IdToValue.
2012-11-19 02:53:14 +02:00
Kalle Olavi Niemitalo
380d910ad8 SMJS: Use JS_THIS_OBJECT and JS_CALLEE, not argv[-1] and argv[-2]
https://developer.mozilla.org/en-US/docs/SpiderMonkey/1.8.5 mentions
that JSNative functions must not use negative indices of argv in
SpiderMonkey 1.8.5.  Use the JS_THIS_OBJECT and JS_CALLEE macros
instead.  They are documented in
https://developer.mozilla.org/en-US/docs/SpiderMonkey/JSAPI_Reference/JSNative
2012-11-19 00:39:51 +02:00
Kalle Olavi Niemitalo
465923e386 ECMAScript: Initialize jsval variables for return values
forms_item declared a variable (jsval val), passed its address to
forms_item2, and set it as the return value.  However, forms_item2
could return without initializing the jsval, especially if given too
many arguments.  Fix by initializing to JSVAL_VOID right away.
I'm not sure that is the correct value to return in such cases,
but at least it's better than risking a crash.

Likewise in form_elements_item and form_elements_namedItem.
2012-11-19 00:39:51 +02:00
Kalle Olavi Niemitalo
245df547ab doxygen: Fix link to bookmark::url
Fix this warning:

Generating docs for page todo...
todo:12: warning: explicit link request to 'url' could not be resolved

The #url syntax was supposed to refer to the url member of the
containing structure, but it apparently doesn't work when @todo
copies the paragraph to a separate page.
2012-11-18 20:17:47 +02:00
Kalle Olavi Niemitalo
31242e8029 doxygen: Document tree parameter of prepare_mustsave_flags
Doxygen complained that not all parameters of prepare_mustsave_flags
were documented.
2012-11-18 20:17:40 +02:00
Kalle Olavi Niemitalo
90d7c11f28 doxygen: Escape <uri> in doc of bittorrent_download
Doxygen warned that <uri> is an unsupported xml/html tag.
It was not intended as a tag though; rather as a placeholder
akin to <var>uri</var>.  Escape with a backslash.
2012-11-18 20:16:59 +02:00
Kalle Olavi Niemitalo
bfeb09fe37 doxygen: Document dump.c some more
Doxygen complained that the cp parameter of dump_output_alloc was not
documented.  Fix that, and document dump_output_prepare_frame too.
2012-11-18 20:16:37 +02:00
Kalle Olavi Niemitalo
6628a3f477 parse_header: document parameters and return value 2012-11-18 17:36:36 +02:00
Kalle Olavi Niemitalo
0386a3e14b parse_header: make the 2nd parameter point to const
In almost all calls to parse_header, the second argument is a string
literal: parse_header(head, "Charset", NULL) for example.
Of course, parse_header does not write to that string.  Accordingly,
make the parameter point to const, so calls that use a variable rather
than a string literal can make that variable point to const too.

Leaving the other parameters non-const for now.
2012-11-18 16:39:04 +02:00
Kalle Olavi Niemitalo
f72cedf92d NEWS: Sync from 0.12pre6 2012-11-03 23:05:37 +02:00
Kalle Olavi Niemitalo
ed6a33d318 http_negotiate: Fix int* vs. size_t* type mismatch
http_negotiate_parse_data passed &token->length as the int *outlen
parameter of base64_decode_bin, which stores an int at that location.
However, gss_buffer_desc::length is size_t in all implementations that
I checked: MIT Kerberos Version 5 Release 1.10, libgssglue 0.4, and
GNU GSS 1.0.2.  This mismatch could cause the build to fail:

.../src/protocol/http/http_negotiate.c: In function ‘http_negotiate_parse_data’:
.../src/protocol/http/http_negotiate.c:173:2: error: passing argument 3 of ‘base64_decode_bin’ from incompatible pointer type [-Werror]
In file included from .../src/protocol/http/http_negotiate.c:30:0:
.../src/util/base64.h:8:16: note: expected ‘int *’ but argument is of type ‘size_t *’

On 64-bit big-endian hosts, it might also cause the GSSAPI
implementation to read too much data from memory and disclose it to
some network server, or crash ELinks.
(cherry picked from elinks-0.12 commit d33c807dd9)
2012-11-03 23:01:29 +02:00
Kalle Olavi Niemitalo
1cba6b46e5 AUTHORS: Kamil Dudka has made three more changes
(related to elinks-0.12 commit 75e9367770)
2012-11-03 23:01:29 +02:00
Kamil Dudka
5e113362da http_negotiate: do not delegate GSSAPI credentials
CVE-2012-4545.  Reported by Marko Myllynen.
(cherry picked from elinks-0.12 commit da18694ff7)
2012-11-03 23:01:28 +02:00
Kalle Olavi Niemitalo
62818a39f9 Unicode/gen-case: Upgrade ISC licence to July 2007 version
I had already done this to my other scripts on 2008-09-28 (commit
c67885d880) but missed Unicode/gen-case.
Update it, and list it in COPYING.

(Although Unicode/gen-case is part of the source tree, this version of
ELinks does not use that file for anything.)
(cherry picked from elinks-0.12 commit c7602eb744)
2012-11-03 23:01:28 +02:00
Kalle Olavi Niemitalo
7072b537a3 elinks.1: Link to GPL 2.0, not GPL 3.0.
(cherry picked from elinks-0.12 commit cc5012db6b)
2012-11-03 23:01:28 +02:00
Kalle Olavi Niemitalo
78e5dd9f0d elinks.conf.5: Refer to manual for MIME options
(cherry picked from elinks-0.12 commit 04388f4b48)
2012-11-03 23:01:28 +02:00
Kalle Olavi Niemitalo
cd0f6feec3 bug 764: Convert sentinel to struct option
unregister_options() requires as a sentinel an instance of struct
option where option.name is NULL.  However, the NULL_OPTION_INFO macro
used for these sentinels actually initializes a struct option_init
instead.  Make register_options() overwrite the NULL_OPTION_INFO with
a sentinel in the correct format.  This probably makes a difference
only on platforms where null pointers don't have all bits zero.
(cherry picked from elinks-0.12 commit 8ac10e00d4)
2012-11-03 23:01:28 +02:00
Kalle Olavi Niemitalo
9e11e30fe3 bug 764, LUA: option_types[OPT_INT].set needs long *
l_set_option() was passing the address of an int to
option_types[OPT_INT].set and option_types[OPT_BOOL].set.
That looks correct but is not: both function pointers
point to num_set(), which actually reads *(long *) str.
Change l_set_option() to pass the address of a long instead,
and add comments about this dependency.
(cherry picked from elinks-0.11 commit 8766e3829f)
(cherry picked from elinks-0.12 commit 0797f04921)
2012-11-03 23:01:28 +02:00
Kalle Olavi Niemitalo
237d30b936 bug 1084: Allow '+' and '*' in names in option manager
ELinks already allowed '+' and '*' in the names of options when
reading a configuration file.  The option manager however didn't
let the user add such options.  Allow the characters there too.

These characters are needed especially in the mime.type tree,
where '*' is used as a replacement for '.'.  For example:

set mime.type.audio.prs*sid = "sid"
set mime.type.application.atom+xml = "atom"

This commit changes one gettextised string.
(cherry picked from elinks-0.12 commit 064ff3921d)
2012-11-03 23:01:21 +02:00
Kalle Olavi Niemitalo
58d2fe8eeb config/options: More Doxygen markup
No changes in program logic or data layout.
(cherry picked from elinks-0.12 commit 972afa1c26)

Conflicts:
	src/config/options.c:
		0.13.GIT has a new function get_option_shadow, now
		doxygenized likewise.
2012-11-03 22:17:47 +02:00
Kalle Olavi Niemitalo
8b00e1ef70 bug 764: Initialize the right member of union option_value
INIT_OPTION used to initialize union option_value at compile time by
casting the default value to LIST_OF(struct option) *, which is the
type of the first member.  On sparc64 and other big-endian systems
where sizeof(int) < sizeof(struct list_head *), this tended to leave
option->value.number as zero, thus messing up OPT_INT and OPT_BOOL
at least.  OPT_LONG however tended to work right.

This would be easy to fix with C99 designated initializers,
but doc/hacking.txt says ELinks must be kept C89 compatible.
Another solution would be to make register_options() read the
value from option->value.tree (the first member), cast it back
to the right type, and write it to the appropriate member;
but that would still require somewhat dubious conversions
between integers, data pointers, and function pointers.

So here's a rather more invasive solution.  Add struct option_init,
which is somewhat similar to struct option but has non-overlapping
members for different types of values, to ensure nothing is lost
in compile-time conversions.  Move unsigned char *path from struct
option_info to struct option_init, and replace struct option_info
with a union that contains struct option_init and struct option.
Now, this union can be initialized with no portability problems,
and register_options() then moves the values from struct option_init
to their final places in struct option.

In my x86 ELinks build with plenty of options configured in, this
change bloated the text section by 340 bytes but compressed the data
section by 2784 bytes, presumably because union option_info is a
pointer smaller than struct option_info was.
(cherry picked from elinks-0.12 commit e5f6592ee2)

Conflicts:
	src/protocol/fsp/fsp.c: All options had been removed in 0.13.GIT.
	src/protocol/smb/smb2.c: Ditto.
2012-11-03 22:16:32 +02:00
Kalle Olavi Niemitalo
7e8c95d934 chmod +x po/gen_translations_stats.sh
po/README suggests running the po/gen_translations_stats.sh script,
and it has a #! line, so it should be executable.
(cherry picked from elinks-0.12 commit 70ef4c8fdd)
2012-11-03 22:16:32 +02:00
Kalle Olavi Niemitalo
bb20653c48 configure: Avoid two errors if TERM=unknown
http://buildd.debian-ports.org/fetch.php?pkg=elinks&arch=hurd-i386&ver=0.12%7Epre5-1&stamp=1247378205&file=log&as=raw
shows two unsightly errors, apparently triggered by TERM=unknown:

tput: unknown terminal "unknown"
/build/buildd/elinks-0.12~pre5/configure: line 25480: test: -ge: unary operator expected

Hide the first of them by redirecting to /dev/null,
and avoid the second one by substituting "0" if tput fails.

I'm not sure why `which tput` is used instead of plain tput,
but it doesn't seem to be causing any problems in practice.
(There are problems in theory if tput is not installed,
tput is found in a directory whose name contains spaces,
or tput is a shell function or builtin.)
(cherry picked from elinks-0.12 commit 4369b052ef)
2012-11-03 22:16:32 +02:00
Kalle Olavi Niemitalo
87eac68dc3 Fix "parameter has incomplete type" on GCC 3.4.6
Fix this GCC 3.4.6 warning, which becomes an error
if configure --enable-debug adds -Werror to CFLAGS:

      [CC]   src/document/css/apply.o
In file included from /home/Kalle/src/elinks-0.12/src/document/html/internal.h:6,
                 from /home/Kalle/src/elinks-0.12/src/document/css/apply.c:35:
/home/Kalle/src/elinks-0.12/src/document/html/parser.h:149: warning: parameter has incomplete type
In file included from /home/Kalle/src/elinks-0.12/src/document/css/apply.c:35:
/home/Kalle/src/elinks-0.12/src/document/html/internal.h:125: warning: parameter has incomplete type

Even without this warning, "enum html_special_type;"
would not be standard C89.
(cherry picked from elinks-0.12 commit c9f487cdf4)

Conflicts:
	src/document/html/parser.h: 0.13.GIT had more #includes already.
2012-11-03 22:16:23 +02:00
Kalle Olavi Niemitalo
263c1836cb Don't retry get_window_title
Call get_window_title() at most once per terminal, even if it fails.
If ELinks is configured with X11 support, get_window_title() calls
XOpenDisplay(), which can sleep if $DISPLAY does not respond.
This delay was previously incurred every time ELinks changed the
title.  Besides, if ELinks had already changed the title, setting
ditrm->orig_title = get_window_title(); did not make sense anyway.
(cherry picked from elinks-0.12 commit 5d4beadc4b)

Conflicts:
	src/terminal/kbd.c:
		get_window_title has a codepage parameter in 0.13.GIT.
2012-11-03 22:14:48 +02:00
Kalle Olavi Niemitalo
6f4c95cc7f Bug 943: Refuse user JS actions in unfocused tabs
(cherry picked from elinks-0.12 commit 51dc3beee7)

Conflicts:
	NEWS: Both 0.12pre5.GIT and 0.13.GIT had inserted a new section.
	src/terminal/window.c: Both had inserted a new function.
2012-11-03 22:10:27 +02:00
Kamil Dudka
a96d8a17e5 rewrite: add default "ddg" dumb/smart prefixes for DuckDuckGo
... and mention that URI rewriting rules may leak ELinks' identity
in the documentation of protocol.http.user_agent.

Originally requested at <https://bugzilla.redhat.com/856348>.
2012-10-05 14:05:13 +02:00