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>
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>
* 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>
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.)
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)
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.
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.
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.
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.
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.
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.
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.
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)
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)
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)
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)
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)
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.
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.
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)
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)
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.
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.
(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.