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

2065 Commits

Author SHA1 Message Date
Kalle Olavi Niemitalo
ac6c03e287 put_link_line: Add a comment related to bug 213. 2007-05-20 14:22:47 +02:00
Jonas Fonseca
211ffef1e6 Refactor test-sgml-parser-basic to work with non-bash shells
A problem with \n replacement caused test no. 19 to fail.
Fix it by also allowing expected output to be prepared in a
file by introducing a new backend: test_output_equals_file,
also used test_output_equals.

Tested on Ubuntu Feisty Fawn with both /bin/bash and /bin/sh
where /bin/sh failed before the fix. Reported by Witek.
2007-05-20 14:22:15 +02:00
Jonas Fonseca
39db04ff39 Check if the program path contains "src/" before using ../po files
Don't look for gettext message catalogs in ../po/ unless ELinks is being
run as src/elinks, ./src/elinks, or .../src/elinks.

Discovered by Arnaud Giersch, this alternate fix (than what is in debian
package 0.11.1-1.4) closes debian bug #417789 and redhat bug #235411.
Also reported in: CVE-2007-2027.

Restricting it to only work with --enable-debug was also considered,
however, it is an important feature for translaters so this less
paranoid fix was chosen.
2007-05-20 14:21:53 +02:00
Kalle Olavi Niemitalo
bf71d024bc Debian bug 380347: Prevent a buffer overflow in entity_cache. 2007-05-20 14:21:09 +02:00
Kalle Olavi Niemitalo
7d9d95961b Revert 2d6840b9, "Only set the socket protocol family on success."
Revert commit 2d6840b9bd9d3a7a45a5ad92b4e98ff7224d6d97.  It is causing
passive FTP via IPv6 to fail on ftp.funet.fi.  ELinks sends PASV and
the server says "425 You cannot use PASV on IPv6 connections. Use EPSV
instead."
2007-05-20 14:20:54 +02:00
Kalle Olavi Niemitalo
07548d5a75 Bug 816, html_textarea: Expand entity references.
Because the renderer no longer does that.
The comment "We don't cope well with entities here" may now be
obsolete but I'm not sure about that so I'm leaving it in.
2007-05-20 14:20:49 +02:00
Kalle Olavi Niemitalo
fc4838b740 html_textarea: Use memmove rather than memcpy.
This is an overlapping copy and memcpy is not required to support that.
2007-05-20 14:20:44 +02:00
Kalle Olavi Niemitalo
0b10539d10 Bug 784: Add html_context->doc_cp and parse attributes with it.
options->cp is still used for this in seven places where html_context
is not easily available.  Those should eventually be corrected too,
but I'm checking this change in already because it's better than what
we had before.
2007-05-20 14:20:35 +02:00
Kalle Olavi Niemitalo
3e16757753 Bug 784: Keep form_control.default_value in the document charset.
Previously, html_special_form_control converted
form_control.default_value to the terminal charset, and init_form_state
then copied the value to form_state.value.  However, when CONFIG_UTF8
is defined and UTF-8 I/O is enabled, form_state.value is supposed to
be in UTF-8, rather than in the terminal charset.

This mismatch could not be conveniently fixed in
html_special_form_control because that does not know which terminal is
being used and whether UTF-8 I/O is enabled there.  Also, constructing
a conversion table from the document charset to form_state.value could
have ruined renderer_context.convert_table, because src/intl/charsets.c
does not support multiple concurrent conversion tables.

So instead, we now keep form_control.default_value in the document
charset, and convert it in the viewer each time it is needed.  Because
the result of the conversion is kept in form_state.value between
incremental renderings, this shouldn't even slow things down too much.

I am not implementing the proper charset conversions for the DOM
defaultValue property yet, because the current code doesn't have
them for other string properties either, and bug 805 is already open
for that.
2007-05-20 14:05:39 +02:00
Kalle Olavi Niemitalo
ec5d0cf0a7 Apply form history to fs->value, not fc->default_value.
I am going make fc->default_value use the charset of the document, and
recoding the string from the form history to that might lose characters.

This change also affects what ECMAScript sees in the defaultValue property.
<http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html#ID-26091157>
says it should represent the HTML "value" attribute, so changing it
based on form history is not appropriate.
2007-05-20 14:05:32 +02:00
Kalle Olavi Niemitalo
3918c8ef1c Document the meaning of document_options.cp.
Miciah provided part of the text.
2007-05-20 14:05:27 +02:00
Laurent Monin
028cd1c4fe Bug 816, html_special_form_control: Don't parse character entity references. 2007-05-20 14:05:22 +02:00
Kalle Olavi Niemitalo
53cd0dcc95 Document the charset of form_state.value for FC_TEXTAREA. 2007-05-20 14:05:17 +02:00
Kalle Olavi Niemitalo
f70c14a706 Bug 947, set_hline: Also recognize NBSP_CHAR #ifndef CONFIG_UTF8. 2007-05-20 14:05:05 +02:00
Kalle Olavi Niemitalo
55102e5f8a Bugs 879, 928, 947: Specially map U+00A0 and U+00AD in translation tables. 2007-05-20 14:05:00 +02:00
Kalle Olavi Niemitalo
c108a425ce Bug 947, set_hline: Respect wrap_nbsp also if !part->document.
This does not yet fix bug 947 for the case where the document is UTF-8
and the terminal is ISO-8859-1.  That will require changing charsets.c
too, it seems.
2007-05-20 14:04:54 +02:00
Kalle Olavi Niemitalo
3baf35b30e set_hline: Outdent some code. 2007-05-20 14:04:50 +02:00
Kalle Olavi Niemitalo
49a3bef153 Bug 879, set_hline: Discard U+00AD SOFT HYPHEN characters if UTF-8.
If not UTF-8, then charsets.c has already discarded them.
2007-05-20 14:04:43 +02:00
Kalle Olavi Niemitalo
c85a226ea4 Bug 879: New constant UCS_SOFT_HYPHEN; use where applicable. 2007-05-20 14:04:36 +02:00
Kalle Olavi Niemitalo
e11b784067 Bug 879, u2cp_: Use UCS_NO_BREAK_SPACE instead of 0xa0. 2007-05-20 14:04:30 +02:00
Witold Filipczyk
86523110d8 DOM: Part of Node properties defined. 2007-05-19 23:16:26 +02:00
Witold Filipczyk
688ca8cf31 ECMAScript: evaluating onclick, onsubmit etc. done in the right way.
Scripts such as onsubmit are called as a function not as a script.
2007-05-19 20:54:08 +02:00
Witold Filipczyk
a29ef8600c DOM: SEE in not supported yet. 2007-05-19 20:43:41 +02:00
Witold Filipczyk
e887efc611 onsubmit: Reverted commit fa93d05b7e.
I don't remember why I cleared "returns", but it doesn't work
with www.hypermedia.pl/altkom/ and probably with many more sites.
2007-05-19 18:47:20 +02:00
Witold Filipczyk
6da89f7acc DOM: Definition of attribute callback. 2007-05-16 21:26:07 +02:00
Witold Filipczyk
e53f3b2c99 DOM: Added add_document_callback and redefined the other callbacks. 2007-05-16 21:21:52 +02:00
Witold Filipczyk
c6a8822926 shadow: Draw transparent shadow like Turbo Vision. 2007-05-16 13:42:36 +02:00
Witold Filipczyk
29bfa86d5d DOM: Added a placeholder for cleaning html_data. 2007-05-13 20:14:43 +02:00
Witold Filipczyk
5626d6499f DOM: Added the html_data field to the struct dom_element_node.
html_data will be used by the future renderer.
2007-05-13 19:58:11 +02:00
Witold Filipczyk
9edc009c10 DOM: Added callbacks when adding an element or an attribute. 2007-05-13 19:46:39 +02:00
Witold Filipczyk
d6c844288a DOM: Node_finalize and done_dom_node_ecmascript_obj.
There should be no dangling pointers to ecmascript_obj.
TODO: Pointer to the root node is needed for performance.
2007-05-13 14:32:33 +02:00
Witold Filipczyk
26966b85bd DOM: Added DOM2-HTML stubs. 2007-05-12 22:26:30 +02:00
Witold Filipczyk
afae921507 DOM: added enums for DOM2-HTML.
Redefined also enums for DOM3-Core in such a way that none of enums
has positive value.
2007-05-12 15:15:23 +02:00
Witold Filipczyk
2252f8d8a9 DOM SpiderMonkey: Typos. 2007-05-10 21:09:45 +02:00
Witold Filipczyk
df573e56e3 DOM: SpiderMonkey's DOM implementation started.
Added placeholders of functions and properties.
2007-05-10 21:04:07 +02:00
Witold Filipczyk
a2f18bb6fc deflate: Used -MAX_WBITS instead of hard coded -15. 2007-05-08 15:28:33 +02:00
Witold Filipczyk
d09334df72 cgi: Set HTTP_ACCEPT_ENCODING. 2007-05-08 09:35:04 +02:00
Witold Filipczyk
f2859f529e encoding: added deflate.
Based on the bzip2 backend. It works (checked with the lighttpd and the PHP
zlib.deflate filter).
2007-05-05 18:57:47 +02:00
Witold Filipczyk
c364abd748 bug 949: Stupid, but works.
Previously object_unlock in push_delete_button_common caused an assertion
failure.
2007-05-02 17:48:06 +02:00
Witold Filipczyk
0f2a24229f bug 949: call done_download_display. 2007-05-02 17:31:40 +02:00
Witold Filipczyk
98450fad79 bug 949: do not remove the downloaded file on abort. 2007-05-02 16:59:41 +02:00
Witold Filipczyk
31768f129a bug 949: Abort button works. 2007-05-02 09:29:39 +02:00
Witold Filipczyk
d26410d0ff bug 397: It works for download_manger. I hope this don't break anything. 2007-05-01 22:07:33 +02:00
Jonas Fonseca
910087ff13 Make non-standard pluginspage attribute to embed hyperlinkable
Appears on page reachable from links on
http://www.gilbertogil.com.br/sec_discografia_view.php?id=17
2007-05-01 20:37:08 +02:00
Laurent MONIN
d5acb25a08 Prevent internal errors when terminal width or height are very small
(1x1 was fatal).
2007-05-01 20:37:03 +02:00
Laurent MONIN
e1332c29ce Insert newlines and remove parenthesis in -version and Info box display. 2007-05-01 20:36:49 +02:00
Laurent MONIN
6bed8f1503 Fix trailing whitespaces 2007-05-01 20:36:04 +02:00
Laurent MONIN
c496a7eaf6 Enhance version and features display. Wrap on spaces when features
are sent to console using -version, and let Info dialog do the job in
interactive mode.
2007-05-01 20:32:52 +02:00
Kalle Olavi Niemitalo
75dbfdb7e2 ELinks 0.13.GIT.
There is a now separate elinks-0.12 branch for the upcoming 0.12.0 release.
2007-05-01 20:32:38 +02:00
Kalle Olavi Niemitalo
1c9165e931 Bug 712, ssl_set_no_tls: Disable TLS protocols for GnuTLS too.
And log this in NEWS, although that may have to be reverted later if
it turns out this change just hides a real bug elsewhere in ELinks.
2007-05-01 20:28:27 +02:00
Simon Josefsson
8c53b32be7 Use gnutls_set_default_priority.
Thereby enabling TLS 1.2 on GnuTLS versions that support it.
2007-05-01 20:28:18 +02:00
Kalle Olavi Niemitalo
e2f26e45f8 l_pipe_read: Don't leak the old block if mem_realloc fails. 2007-05-01 20:28:12 +02:00
Kalle Olavi Niemitalo
b195975a27 Bug 945: Don't crash if the error message is not a string. 2007-05-01 20:27:16 +02:00
Kalle Olavi Niemitalo
4766314960 Bug 941: Survive an unexpected number of 227 or 229 FTP responses.
And document the functions a little.

[ From commit 71ff470f2e in ELinks
  0.11.2.GIT.  --KON ]
2007-05-01 20:24:36 +02:00
Kalle Olavi Niemitalo
792bb98e58 charset_list: Map the "System" codepage to the underlying one.
If LC_CTYPE=fi_FI.ISO-8859-15, and terminal.*.charset = System,
then the charset menu will select ISO 8859-15 by default.
2007-05-01 20:24:20 +02:00
Kalle Olavi Niemitalo
4821d841c7 do_move_bookmark: Update comment to match reality.
[ From commit 22d051925e in ELinks
  0.11.2.GIT.  --KON ]
2007-05-01 20:23:34 +02:00
Kalle Olavi Niemitalo
37ca87a01e do_smb: URI-encode the username and password.
I tested that this does the right thing for the username "Kalle %50"
(encodes it to "Kalle%20%2550", and libsmbclient then decodes back).
2007-05-01 20:23:29 +02:00
Kalle Olavi Niemitalo
33319cd842 do_smb: Don't decode_uri.
libsmbclient will decode the URI on its own, so if ELinks does that too,
file names like "2%200" will be incorrectly handled.
2007-05-01 20:22:07 +02:00
Kalle Olavi Niemitalo
9418f3d508 TAGS: Doh, don't forget to scan the *.[ch] files. 2007-05-01 20:22:02 +02:00
Kalle Olavi Niemitalo
64159aa70a TAGS: Scan *.inc too. Recognize the ACTION_ macro. 2007-05-01 20:21:57 +02:00
Kalle Olavi Niemitalo
13acf06876 Don't mark undisplayed names of modules for translation.
Exclude unneeded header files.  This partially reverts commit
90980a944e, with permission.
2007-05-01 20:21:50 +02:00
Kalle Olavi Niemitalo
ac818c4837 report_scripting_error: Look up module names with gettext. 2007-05-01 20:21:42 +02:00
Laurent MONIN
a4f1b7e489 Mark all module names for translation and include needed header files. 2007-05-01 20:20:15 +02:00
Kalle Olavi Niemitalo
36ce51f912 ftp: Decode strftime results from the system codepage. 2007-05-01 20:20:09 +02:00
Kalle Olavi Niemitalo
605d04378f add_cp_html_to_string: New function.
To be used when strings from gettext or strftime must be inserted
into an HTML document with a potentially different charset.
2007-05-01 20:20:04 +02:00
Kalle Olavi Niemitalo
269a8f4397 ftp: Collect HTML formatting parameters into a structure. 2007-05-01 20:19:58 +02:00
Kalle Olavi Niemitalo
21bdcad9c7 ftp: Allocate a larger buffer for the timestamp string. 2007-05-01 20:19:53 +02:00
Kalle Olavi Niemitalo
b636024ede ftp: Don't pad the timestamp column with spaces. 2007-05-01 20:19:48 +02:00
Kalle Olavi Niemitalo
d696d6530f show_http_error_document: Generate a charset parameter. 2007-05-01 20:19:41 +02:00
Kalle Olavi Niemitalo
b29655f25f file: Directory listings are in the system charset.
Give them a corresponding Content-Type header.  This must go in
cached->head because cached->content_type is supposed to be just
type/subtype.  It will also be deduced from cached->head, so don't set
it separately.
2007-05-01 20:19:34 +02:00
Kalle Olavi Niemitalo
55bce38eee struct directory_entry: Document the charset and mem_free. 2007-05-01 20:19:29 +02:00
Kalle Olavi Niemitalo
e1bc8aafcc add_date_to_string: Let last two parameters point to const. 2007-05-01 20:19:24 +02:00
Kalle Olavi Niemitalo
a4dee5acba intl: Fork get_cp_config_name off get_cp_mime_name.
This may help with bug 914 but I'm not testing that yet.
2007-05-01 20:19:18 +02:00
Kalle Olavi Niemitalo
81cb9155d2 add_html_to_string: Do not encode bytes 0x80...0xFF.
Reported by Witold Filipczyk.
2007-05-01 20:19:11 +02:00
Kalle Olavi Niemitalo
65efed3e83 Use add_string_to_string where applicable. 2007-05-01 20:19:06 +02:00
Kalle Olavi Niemitalo
43b8bdd8c3 add_string_to_string: Don't fail if @from is empty.
Old versions of add_string_to_string returned the target string
unmodified if from->source pointed to a null character, which usually
meant that the source string was empty.  That was changed in commit
5e18576391f75ad84e04f9c8a30b93d08f0b92ab on 2004-11-03 so that
add_string_to_string instead returned NULL in that situation.  The
change seems to have been inadvertent.

I'm now reverting that change and also making add_string_to_string
check the emptiness of the source string based on the stored length
only, rather than on any null characters.  So the function can now
also be used with non-C strings containing embedded null characters.
Note that the previous version did not completely prevent embedded
null characters either, because it checked only the first character.
2007-05-01 20:19:00 +02:00
Kalle Olavi Niemitalo
ae62c0ef46 utf8_to_unicode: Let the end parameter point to const. 2007-05-01 20:18:54 +02:00
Kalle Olavi Niemitalo
7e86205902 add_html_to_string: Also restore the '\0' terminator. 2007-05-01 20:17:28 +02:00
Kalle Olavi Niemitalo
14d79f6c91 add_html_to_string: If out of memory, roll back and return NULL. 2007-05-01 20:17:19 +02:00
Kalle Olavi Niemitalo
8c9858b6a0 add_html_to_string: Encode only known unsafe or non-ASCII characters.
In particular, do not encode '%' and '/', which are common in URIs.
2007-05-01 20:17:04 +02:00
Kalle Olavi Niemitalo
bd0dce9a3a init_directory_listing: Link to original URLs. Decode for display only.
HTML-escape all strings that are not intended to contain markup.
2007-05-01 20:16:46 +02:00
Witold Filipczyk
07843f924c Hack to let auto-commiting work. 2007-05-01 20:16:43 +02:00
Kalle Olavi Niemitalo
de2ce3319c More const in URI functions.
Not yet all of them, though.
2007-05-01 20:08:25 +02:00
Kalle Olavi Niemitalo
bca031d1ba ftp, add_file_cmd_to_str: Check errors from string functions.
Use goto for error handling.  Free all strings in the same place.
2007-05-01 20:08:19 +02:00
Kalle Olavi Niemitalo
4bcce2e5ea Reject CR and LF characters in FTP pathnames. 2007-05-01 20:08:13 +02:00
Kalle Olavi Niemitalo
12d94d3408 Cast the NULL argument of string_concat to unsigned char *.
string_concat reads the args with va_arg(ap, const unsigned char *),
and the NULL macro may have the wrong type (e.g. int).

Many places pass string literals of type char * to string_concat.
This is in principle also a violation, but I'm ignoring it for now
because if it becomes a problem with some C implementation, then so
will the use of unsigned char * with printf "%s", which is so
widespread in ELinks that I'm not going to try fixing it now.
2007-05-01 20:05:12 +02:00
Kalle Olavi Niemitalo
7e71f929af Cast the NULL argument of straconcat to unsigned char *.
straconcat reads the args with va_arg(ap, const unsigned char *),
and the NULL macro may have the wrong type (e.g. int).

Many places pass string literals of type char * to straconcat.  This
is in principle also a violation, but I'm ignoring it for now because
if it becomes a problem with some C implementation, then so will the
use of unsigned char * with printf "%s", which is so widespread in
ELinks that I'm not going to try fixing it now.
2007-05-01 20:05:04 +02:00
Kalle Olavi Niemitalo
33b8f7175e Cast variadic arguments of add_to_ml to void *.
getml reads the args with va_arg(ap, void *), and the NULL macro in
particular may have the wrong type.
2007-05-01 20:04:57 +02:00
Kalle Olavi Niemitalo
b35505c813 Cast variadic arguments of getml to void *.
getml reads the args with va_arg(ap, void *), and the NULL macro in
particular may have the wrong type.
2007-05-01 20:04:50 +02:00
Kalle Olavi Niemitalo
d00d702e7d Fix compiler errors without HAVE_VARIADIC_MACROS. 2007-05-01 20:04:10 +02:00
Kalle Olavi Niemitalo
2e3ebffcd3 string_assert: First arg of elinks_internal is a format string. 2007-05-01 19:59:04 +02:00
Kalle Olavi Niemitalo
b0bc06d050 XBEL: Fix us-ascii charset lookup.
Previously, print_xml_entities did look up the charset, but did not
save the result anywhere and just used 0, leading to further lookups
in subsequent calls.  It worked by accident though, because the
codepage index of us-ascii currently is 0.
2007-05-01 19:58:50 +02:00
Kalle Olavi Niemitalo
d2e806b611 textarea_edit: Cast size_t fx_maxlength to match "%u". 2007-05-01 19:58:35 +02:00
Kalle Olavi Niemitalo
5692746935 menu_leds_info: Revert the previous change.
Revert commit 2380ea9f1b,
"menu_leds_info: Don't call msg_text."  MSGBOX_SCROLLABLE requires
a modifiable copy of the string, and msg_text provides that.  To
reproduce the crash, run ELinks in a small window, select the English
language, and choose Help -> LED indicators.
2007-05-01 19:58:22 +02:00
Kalle Olavi Niemitalo
6c33b4ecf8 menu_leds_info: Don't call msg_text. 2007-05-01 19:58:10 +02:00
Kalle Olavi Niemitalo
9a930fefe1 Type-check button arguments of msg_box.
Don't cast function pointers; calling functions via pointers of
incorrect types is not guaranteed to work.  Instead, define the
functions with the desired types, and make them cast the incoming
parameters.  Or define wrapper functions if the return types don't
match.

really_exit_prog wasn't being used outside src/dialogs/menu.c,
and I had to change its parameter type, so it's now static.
2007-05-01 19:57:52 +02:00
Kalle Olavi Niemitalo
c2570007c1 OS/2: Ensure correct type of NULL pointer for variadic spawnlp. 2007-05-01 19:57:31 +02:00
Witold Filipczyk
17ef838be7 DOM renderer: off by one error. 2007-04-29 21:06:03 +02:00
Witold Filipczyk
6d4828440e ecmascript: Added clearTimeout. 2007-04-26 22:36:02 +02:00
Witold Filipczyk
05d40f6a63 ecmascript: Added ecmascript_clear_timeout. 2007-04-26 21:04:30 +02:00