1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-10-01 03:36:26 -04:00
Commit Graph

2156 Commits

Author SHA1 Message Date
Jonas Fonseca
201ce1ec85 Use printf to handle test string containing escapes more portable
Works with both bash and dash. This reintroduces the fix to the
test-sgml-parser-basic test, and also fixes test-sgml-parser-incremental
and test-sgml-parser-lines, which Witek has reported as failing.
2007-05-26 13:01:22 +02:00
Jonas Fonseca
7d2eb84de0 Revert "Refactor test-sgml-parser-basic to work with non-bash shells"
This reverts commit 3f93148c9b.
2007-05-26 13:01:16 +02:00
Witold Filipczyk
21ed212b15 shadow: Draw a transparent shadow on the Linux console, too.
set ui.colors.color.dialog.shadow.text = "#555555"
set ui.colors.color.dialog.shadow.background = "black"

and enjoy!
2007-05-25 11:51:40 +02:00
Witold Filipczyk
1b85b63f97 file: set_nonblocking_fd when reading from the copiousoutput's pipe. 2007-05-24 12:29:29 +02:00
Witold Filipczyk
e75522d19c DOM: Defined properties of HTML elements.
All of them are the "unsigned char *" type. This should be changed.
2007-05-23 22:57:55 +02:00
Witold Filipczyk
d4adfb3cd0 bug 755: Fixed.
Remember the index of struct form_state in vs->form_info
instead of the pointer to it. The pointer may change,
the index is persistent.
The field ecmascript_obj of the struct form_state is unused.
2007-05-22 16:07:06 +02:00
Witold Filipczyk
b09135a612 SEE: bug 755 doesn't occur. 2007-05-22 10:45:36 +02:00
Witold Filipczyk
bb59860c23 ecmascript: Convert numbers using JS_ValueToInt32. 2007-05-22 09:36:39 +02:00
Witold Filipczyk
08cab91214 bug 755: attempt to fix this bug. 2007-05-21 12:50:27 +02:00
Witold Filipczyk
f70e438820 DOM: node was unitialized. 2007-05-20 21:03:15 +02:00
Witold Filipczyk
ca62325a53 speech: Compilation fix. 2007-05-20 20:39:54 +02:00
Kalle Olavi Niemitalo
dfb74267f8 Bug 461: Ensure contrast when filling with spaces.
So that the cursor will be visible in the Linux console.
2007-05-20 20:21:52 +02:00
Kalle Olavi Niemitalo
e57d1f6aba And ignore ID files while we're at it. 2007-05-20 20:21:47 +02:00
Kalle Olavi Niemitalo
2a2203ef92 Place the TAGS file in the source directory. 2007-05-20 20:21:40 +02:00
Kalle Olavi Niemitalo
d562bdc77c Document terminal._template_.m11_hack more and add comments. 2007-05-20 20:21:27 +02:00
Kalle Olavi Niemitalo
ed88ddf1a3 Bug 914: Add screen_driver_opt.utf8_cp, not yet read. 2007-05-20 20:21:19 +02:00
Kalle Olavi Niemitalo
44e8a38693 Bug 914: Don't let UTF-8 I/O affect internal representations.
Use it for the actual I/O only.  Previously, defining CONFIG_UTF8 and
enabling UTF-8 used to force many strings to the UTF-8 charset
regardless of the terminal charset option.  Now, those strings always
follow the terminal charset.  This fixes bug 914 which was caused
because _() returned strings in the terminal charset and functions
then assumed they were in UTF-8.  This reduction in the effects of
UTF-8 I/O may also simplify future testing.
2007-05-20 20:11:55 +02:00
Kalle Olavi Niemitalo
ad669a3f0f Bug 914: Add terminal.utf8_cp, not yet read. 2007-05-20 20:11:48 +02:00
Witold Filipczyk
774471b6d1 DOM: Some methods of the Element interface defined. 2007-05-20 19:51:25 +02:00
Kalle Olavi Niemitalo
ebd4b979c1 UTF-8, add_char_data: data can be UCS_NO_CHAR after all. 2007-05-20 14:24:52 +02:00
Kalle Olavi Niemitalo
e099a05a57 Whitespace and comments. 2007-05-20 14:24:47 +02:00
Kalle Olavi Niemitalo
0c3d05817e UTF-8, set_screen_driver_opt: Never use frame_seqs with UTF-8 I/O. 2007-05-20 14:24:41 +02:00
Kalle Olavi Niemitalo
f970994640 UTF-8: frame_freebsd isn't in CP437 so use a separate table for UTF-8 I/O. 2007-05-20 14:24:35 +02:00
Kalle Olavi Niemitalo
2e91945b69 UTF-8: Comment about frame_freebsd[]. 2007-05-20 14:24:30 +02:00
Kalle Olavi Niemitalo
b2186fadf4 UTF-8: Use frame_vt100_u even #ifdef CONFIG_UTF8.
Should perhaps have been part of the previous commit.
2007-05-20 14:24:25 +02:00
Kalle Olavi Niemitalo
cdd0cd98bf UTF-8: Make UTF-8 I/O affect frame characters even #ifdef CONFIG_UTF8. 2007-05-20 14:24:18 +02:00
Kalle Olavi Niemitalo
d1da2e938e UTF-8, add_char_data: Comment about UCS_NO_CHAR. 2007-05-20 14:24:14 +02:00
Kalle Olavi Niemitalo
976b0d26ad UTF-8: Remove screen_driver_opt.utf8, which is no longer used. 2007-05-20 14:24:08 +02:00
Kalle Olavi Niemitalo
d561304524 UTF-8, use_utf8_io: Test driver->opt.charsets[0] even #ifdef CONFIG_UTF8.
driver->opt.utf8 is no longer read and will soon be removed.
2007-05-20 14:24:03 +02:00
Kalle Olavi Niemitalo
3260bcec20 UTF-8: Define and set screen_driver_opt.charsets even #ifdef CONFIG_UTF8.
However, the stored values are not yet read in this commit.
2007-05-20 14:23:57 +02:00
Kalle Olavi Niemitalo
4baf668f28 UTF-8, set_screen_driver_opt: Don't test driver->opt.utf8 after utf8_io.
They have the same value so one test will suffice.
2007-05-20 14:23:50 +02:00
Kalle Olavi Niemitalo
aa490bab64 UTF-8, set_screen_driver_opt: Shrink #ifdef CONFIG_UTF8 regions. 2007-05-20 14:23:44 +02:00
Kalle Olavi Niemitalo
b2d35c73ec UTF-8, set_screen_driver_opt: Duplicate CONFIG_UTF8 code. 2007-05-20 14:23:39 +02:00
Kalle Olavi Niemitalo
5261cd17d1 UTF-8: Change type of constants to struct screen_driver_opt.
We don't need a full struct screen_driver here.
2007-05-20 14:23:33 +02:00
Kalle Olavi Niemitalo
3786dd9265 UTF-8: Leave driver->opt initialization to set_screen_driver_opt.
Don't bother to initialize driver->opt with memcpy in add_screen_driver.
2007-05-20 14:23:27 +02:00
Kalle Olavi Niemitalo
f8fdf6a93d UTF-8: Rename update_screen_driver to set_screen_driver_opt. 2007-05-20 14:23:21 +02:00
Kalle Olavi Niemitalo
b493ab8b9e UTF-8, update_screen_driver: Restore all original options. 2007-05-20 14:23:16 +02:00
Kalle Olavi Niemitalo
73b67d34dc UTF-8: New struct screen_driver_opt engulfs most of struct screen_driver.
No behaviour changes yet, although padding may differ.
2007-05-20 14:23:11 +02:00
Kalle Olavi Niemitalo
b6855c8616 UTF-8, update_screen_driver: First read the "charset" option. 2007-05-20 14:23:05 +02:00
Kalle Olavi Niemitalo
0d9be10fe4 UTF-8, update_screen_driver: A small rearrangement.
This does not change the behaviour but will help later changes.
2007-05-20 14:22:59 +02:00
Kalle Olavi Niemitalo
39bd97f11e UTF-8: Whitespace changes. 2007-05-20 14:22:54 +02:00
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
Witold Filipczyk
f047c7c5fc ecmascript: ecmascript_set_timeout returns pointer.
This pointer will be used later by clearTimeout.
2007-04-26 21:00:50 +02:00
Witold Filipczyk
479f63036a ecmascript: Handle multiple setTimeout simultaneously. 2007-04-26 20:49:56 +02:00
Witold Filipczyk
2a3be5260a forms: Buttons should not submit forms.
This reverts Commit: 6fe1a431f1
    Sometimes scripts submit forms using buttons
I don't remember why I did previous change, but it was broken.
2007-04-18 16:19:18 +02:00
Witold Filipczyk
df36759e80 SEE: Report errors. 2007-04-15 17:57:30 +02:00
Witold Filipczyk
bcb22e301f SEE: Simplification. 2007-04-15 16:59:04 +02:00
Witold Filipczyk
b5c3baf910 SEE: Renamed ELinks functions with the "SEE" prefix to distinguish them
from SEE functions.
2007-04-15 16:53:14 +02:00
Witold Filipczyk
c5b102ba08 SEE: added forms to the global object.
Avoid dangerous document.forms = ...
2007-04-14 23:49:43 +02:00
Witold Filipczyk
cd982d7d65 SEE: do not do check_class for alert, open and setTimeout.
Do not do check_class when functions called by the global object.
2007-04-14 23:32:14 +02:00
Witold Filipczyk
182812352b bug 620: reset forms before reload, not after.
The idea by Kalle Olavi Niemitalo.
2007-03-26 19:21:23 +02:00