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

2607 Commits

Author SHA1 Message Date
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
12b9e0cd00 Tell xgettext which functions pass through format strings.
These are the same functions whose argument strings xgettext should
add to elinks.pot.  I also searched for uses of the functions that are
known to take format strings, in case the callers might take the
format string from the result of another function, but didn't find any
new ones.
2007-05-01 20:04:43 +02:00
Kalle Olavi Niemitalo
d00d702e7d Fix compiler errors without HAVE_VARIADIC_MACROS. 2007-05-01 20:04:10 +02:00
Kalle Olavi Niemitalo
24ba641743 Tell xgettext which functions expect format strings.
I constructed the list by grepping for "..." and looking for related
macros and va_list functions.  Also grepped for "*fmt", and "*format"
but the extra functions found that way (add_date_to_string,
format_command, subst_user_agent, etc.) handle format strings that
don't have the same syntax as in printf: in particular, type safety
does not depend on the order of format specifiers like it does in
printf.  Therefore, these format strings should not be subjected to
the "c-format" checks of msgfmt.
2007-05-01 19:59:18 +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
Laurent MONIN
8931ec44f2 French translation was updated. 2007-05-01 19:56:09 +02:00
Jonas Fonseca
1991e481f3 release.txt: remember to add version number to NEWS file
Thanks to kahmalo.
2007-05-01 19:55:55 +02:00
Jonas Fonseca
7fd92f31ee Add .mailmap file to help git-shortlog 2007-05-01 19:55:40 +02:00
Witold Filipczyk
17ef838be7 DOM renderer: off by one error. 2007-04-29 21:06:03 +02:00
Witold Filipczyk
71c13ecbdb test: scroll.html tests setTimeout and clearTimeout. 2007-04-26 22:37:09 +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
Witold Filipczyk
1655de5699 BUILD_ID: Use cg-object-id when there is no cg-commit-id 2007-03-23 19:01:21 +01:00
Witold Filipczyk
00037979d2 check_html_form_hierarchy: Old code was buggy.
Old code caused the assertion failure on the shutdownday's page.
2007-03-23 13:16:39 +01:00
Witold Filipczyk
55c00e0a12 memdebug: Show the previous address of the allocated memory (mem_realloc).
Without this tracking of the memory allocation is IMHO impossible.
2007-03-22 10:05:47 +01:00