Kalle Olavi Niemitalo
699663614a
l_pipe_read: Don't leak the old block if mem_realloc fails.
2007-04-19 00:15:30 +03:00
Kalle Olavi Niemitalo
c645ed7485
Bug 945: Don't crash if the error message is not a string.
2007-04-15 02:20:41 +03:00
Kalle Olavi Niemitalo
049cc9c6b3
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-04-12 01:02:00 +03:00
Kalle Olavi Niemitalo
22413166b0
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-04-09 12:33:18 +03:00
Kalle Olavi Niemitalo
5d22006f93
do_move_bookmark: Update comment to match reality.
...
[ From commit 22d051925e
in ELinks
0.11.2.GIT. --KON ]
2007-04-01 15:02:47 +03:00
Kalle Olavi Niemitalo
9955ca8e5a
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-03-25 12:13:46 +03:00
Kalle Olavi Niemitalo
d30eb255ce
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-03-24 21:19:41 +02:00
Kalle Olavi Niemitalo
f2f66104d5
TAGS: Doh, don't forget to scan the *.[ch] files.
2007-03-23 09:47:28 +02:00
Kalle Olavi Niemitalo
5b4ba36283
TAGS: Scan *.inc too. Recognize the ACTION_ macro.
2007-03-23 09:44:16 +02:00
Kalle Olavi Niemitalo
443db69980
Don't mark undisplayed names of modules for translation.
...
Exclude unneeded header files. This partially reverts commit
90980a944e
, with permission.
2007-03-23 00:51:56 +02:00
Kalle Olavi Niemitalo
48fd725c40
report_scripting_error: Look up module names with gettext.
2007-03-22 07:55:59 +02:00
Kalle Olavi Niemitalo
2558688456
Merge with http://elinks.cz/elinks.git
2007-03-22 07:48:49 +02:00
Laurent MONIN
90980a944e
Mark all module names for translation and include needed header files.
2007-03-21 11:01:06 +01:00
Kalle Olavi Niemitalo
62bdfcf732
ftp: Decode strftime results from the system codepage.
2007-03-20 21:34:39 +02:00
Kalle Olavi Niemitalo
632069d14d
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-03-20 21:32:14 +02:00
Kalle Olavi Niemitalo
ef1d6c563d
ftp: Collect HTML formatting parameters into a structure.
2007-03-20 21:30:20 +02:00
Kalle Olavi Niemitalo
c8eccc486b
ftp: Allocate a larger buffer for the timestamp string.
2007-03-20 21:28:30 +02:00
Kalle Olavi Niemitalo
9d45ff5be1
ftp: Don't pad the timestamp column with spaces.
2007-03-20 21:26:46 +02:00
Kalle Olavi Niemitalo
3c6c79a637
show_http_error_document: Generate a charset parameter.
2007-03-20 20:53:03 +02:00
Kalle Olavi Niemitalo
9a8fa9d7db
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-03-20 20:50:41 +02:00
Kalle Olavi Niemitalo
baee24bb3c
struct directory_entry: Document the charset and mem_free.
2007-03-20 20:49:32 +02:00
Kalle Olavi Niemitalo
8b8ff255bd
add_date_to_string: Let last two parameters point to const.
2007-03-20 20:42:45 +02:00
Kalle Olavi Niemitalo
8c66e34323
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-03-20 20:41:05 +02:00
Kalle Olavi Niemitalo
aa79ecfe72
add_html_to_string: Do not encode bytes 0x80...0xFF.
...
Reported by Witold Filipczyk.
2007-03-19 08:32:43 +02:00
Kalle Olavi Niemitalo
44adb76799
Use add_string_to_string where applicable.
2007-03-18 20:29:08 +02:00
Kalle Olavi Niemitalo
4a23d7fd82
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-03-18 20:13:24 +02:00
Kalle Olavi Niemitalo
2ac31b6144
utf8_to_unicode: Let the end parameter point to const.
2007-03-18 20:13:15 +02:00
Witold Filipczyk
e347122e6d
get_attr_value: do not do trim_chars
...
trim_chars was called only in debug mode and the results of the get_attr_val
for value=" something " in debug mode differ from normal and fastmem mode.
[ From commit c4500039b2
on the witekfl
branch. --KON ]
2007-03-18 13:32:25 +02:00
Witold Filipczyk
d2970e57af
accesskey: start iterating with next link.
...
Rotating between links with the same accesskey works.
[ From commit c2d1952a08
on the witekfl branch. --KON ]
2007-03-18 12:55:56 +02:00
Witold Filipczyk
682ad62a97
Accesskey didn't work as it should.
...
[ From commit 5008fb697d
on the witekfl branch. --KON ]
2007-03-18 12:55:29 +02:00
Kalle Olavi Niemitalo
b7dddaa685
add_html_to_string: Also restore the '\0' terminator.
2007-03-18 12:36:33 +02:00
Kalle Olavi Niemitalo
28645973e5
add_html_to_string: If out of memory, roll back and return NULL.
2007-03-18 11:13:38 +02:00
Kalle Olavi Niemitalo
36dd1fa267
add_html_to_string: Encode only known unsafe or non-ASCII characters.
...
In particular, do not encode '%' and '/', which are common in URIs.
2007-03-18 11:10:33 +02:00
Kalle Olavi Niemitalo
3ee04479d4
init_directory_listing: Link to original URLs. Decode for display only.
...
HTML-escape all strings that are not intended to contain markup.
2007-03-18 11:04:02 +02:00
Kalle Olavi Niemitalo
b48a2d660d
More const in URI functions.
...
Not yet all of them, though.
2007-03-18 09:57:29 +02:00
Kalle Olavi Niemitalo
c6b8fa7151
ftp, add_file_cmd_to_str: Check errors from string functions.
...
Use goto for error handling. Free all strings in the same place.
2007-03-18 09:32:47 +02:00
Kalle Olavi Niemitalo
adfde652b9
Reject CR and LF characters in FTP pathnames.
2007-03-18 08:53:56 +02:00
Witold Filipczyk
3f4de99f16
ftp: ftp didn't handle filenames with spaces.
2007-03-18 08:15:54 +02:00
Witold Filipczyk
026e56d539
Used add_shell_quoted_to_string instead of enclosing the text with '"'.
...
The code works both with copiousoutput and without it.
[ Part 1/2 of commit c25c41bd18
on the
witekfl branch. I'm leaving out the part that depends on commit
469481b272
, which is not yet safe to
apply. --KON ]
2007-03-12 19:22:41 +02:00
Witold Filipczyk
b3fa9a7019
MIME: When there is no % in the handler string (no %s in the mailcap entry)
...
the handler reads data from stdin. I think it only works with copiousoutput.
[ Part 1/2 of commit 4a7b9415e1
on the
witekfl branch, fixes bug 916. I'm leaving out delayed_goto_uri()
for now because I don't understand its purpose. --KON ]
2007-03-12 19:19:57 +02:00
Witold Filipczyk
988313ac9b
The real fix for the bug 935.
...
It works for not utf-8 and the code doesn't affect the utf-8 mode.
2007-03-11 17:00:29 +02:00
Kalle Olavi Niemitalo
a495f6d26a
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-03-11 13:01:50 +02:00
Kalle Olavi Niemitalo
7645a836fc
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-03-11 12:59:11 +02:00
Kalle Olavi Niemitalo
22af2b22e2
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-03-11 12:44:13 +02:00
Kalle Olavi Niemitalo
a05f7203cd
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-03-11 12:41:17 +02:00
Kalle Olavi Niemitalo
801d520ddd
Fix compiler errors without HAVE_VARIADIC_MACROS.
2007-03-11 12:22:02 +02:00
Kalle Olavi Niemitalo
a73d165fd7
string_assert: First arg of elinks_internal is a format string.
2007-03-11 10:41:58 +02:00
Kalle Olavi Niemitalo
e325b748be
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-03-11 10:36:44 +02:00
Kalle Olavi Niemitalo
0dfb88c802
textarea_edit: Cast size_t fx_maxlength to match "%u".
2007-03-11 00:25:42 +02:00
Kalle Olavi Niemitalo
2bd2686672
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-03-11 00:18:33 +02:00
Kalle Olavi Niemitalo
2380ea9f1b
menu_leds_info: Don't call msg_text.
2007-03-11 00:05:25 +02:00
Kalle Olavi Niemitalo
2b7788614f
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-03-10 23:50:56 +02:00
Kalle Olavi Niemitalo
1e8a61e09b
OS/2: Ensure correct type of NULL pointer for variadic spawnlp.
2007-03-10 23:12:31 +02:00
Kalle Olavi Niemitalo
701e7e3e64
cgi: Avoid assertion failure when the POST data is empty.
2007-03-10 16:56:16 +02:00
Witold Filipczyk
035ce283c7
cgi: Fix the possible memleak and close pipes in case of error.
2007-03-10 13:45:56 +02:00
Witold Filipczyk
eef7924ff1
POST method of CGI did not work. It works now.
2007-03-10 13:45:35 +02:00
Kalle Olavi Niemitalo
4c636d74f1
cgi: Ensure correct type of NULL pointer to variadic execl.
2007-03-10 13:19:31 +02:00
Witold Filipczyk
2828d587b2
cgi: set_nonblocking_fd
...
[ This is part of commit 71adb0e6cc
from the witekfl branch. The SMB part is in commit
36477ffa45
, and the FSP part is
in commit 93f3dc3bbf
. --KON ]
2007-03-10 13:10:35 +02:00
Kalle Olavi Niemitalo
87431832be
Document the syntax of protocol.rewrite.default_template.
2007-03-10 12:15:06 +02:00
Kalle Olavi Niemitalo
c068ca92c0
get_http_error_document: Change "happenned" to "happened".
2007-03-10 11:16:26 +02:00
Kalle Olavi Niemitalo
f2fc402093
Merge with http://elinks.cz/elinks.git
2007-03-06 16:01:21 +02:00
Kalle Olavi Niemitalo
f905379aed
smb: Use atol rather than atoi for file sizes.
...
Corresponds to FSP commit 9f47368894
.
2007-03-06 15:59:14 +02:00
Kalle Olavi Niemitalo
3b634ffee6
smb: Don't call qsort with a NULL pointer.
...
Corresponds to FSP commit 97edc3a2cc
.
2007-03-06 15:59:06 +02:00
Kalle Olavi Niemitalo
6ae6c0b438
smb: Remove a cast.
...
Corresponds to FSP commit 95a377e81b
.
2007-03-06 15:59:00 +02:00
Kalle Olavi Niemitalo
846a368fb0
smb: Assert that there is room for a terminating null.
...
Corresponds to FSP commit 23b4b912ac
.
2007-03-06 15:58:50 +02:00
Kalle Olavi Niemitalo
588375444b
smb: Comment about not freeing memory in the child process.
...
Corresponds to FSP commit 368a749123
.
2007-03-06 15:58:45 +02:00
Kalle Olavi Niemitalo
146a605938
smb: Call close_socket(socket) rather than close(socket->fd).
...
Corresponds to FSP commit 3ba31763a9
.
2007-03-06 15:58:38 +02:00
Kalle Olavi Niemitalo
c19ad66070
smb: Comment and FIXME about closing file descriptors.
...
Corresponds to FSP commit 1ad016bdd5
.
2007-03-06 15:58:28 +02:00
Kalle Olavi Niemitalo
e08d040c4c
smb: Don't cast the qsort comparison function pointer.
...
Inspired by FSP commit c3a6ca3ef0
.
This time, the cast was a no-op though.
2007-03-06 15:58:24 +02:00
Kalle Olavi Niemitalo
9665f1b813
smb: More const.
...
Inspired by FSP commit c06d6ba5d0
.
2007-03-06 15:58:07 +02:00
Kalle Olavi Niemitalo
327de14aa8
smb: Fix libsmbclient 3.0.10 compatibility.
...
Also, allocate memory for only one copy of each comment string, rather
than two.
2007-03-06 15:57:58 +02:00
Kalle Olavi Niemitalo
f621ed63b4
Revert 11e6aa8d97
, "Bug 944, SMB: Fix leaks and libsmbclient 3.0.10 compatibility."
...
Revert commit 11e6aa8d97
.
It is not useful to complicate the code to free the memory,
because the process is soon going to exit, and it has inherited
a lot more memory allocations from its parent.
The libsmbclient 3.0.10 compatibility changes are good though.
I'll re-apply them soon enough.
2007-03-06 15:57:40 +02:00
Kalle Olavi Niemitalo
e517ef22a9
fsp: Try to recover from ABI mismatches caused by _FILE_OFFSET_BITS.
2007-03-06 15:57:18 +02:00
Laurent MONIN
f2916d8646
unblock_itrm(),block_itrm(): drop unused parameter fd.
2007-03-05 22:54:24 +01:00
Laurent MONIN
e4256e0e6a
Refresh status bar when key prefix is eaten. It fixes bug 930.
2007-03-05 22:15:50 +01:00
Laurent MONIN
d7400bed08
asprintf() is not used in this file.
2007-03-05 22:04:34 +01:00
Laurent MONIN
86686983c0
save_textarea_file(): do not open file for writing if not needed. Patch
...
by Alexey Tourbin.
2007-03-05 21:48:42 +01:00
Laurent MONIN
ecce8bfa91
save_textarea_file(): handle return values of fwrite() and fclose(). Patch
...
by Alexey Tourbin.
2007-03-05 21:47:09 +01:00
Laurent MONIN
1e00f2d10d
save_textarea_file(): cleanup handling of error, closing descriptors
...
and unlinking created file. Patch by Alexey Tourbin.
2007-03-05 21:44:58 +01:00
Laurent MONIN
12ec62810b
save_textarea_file(): h -> fd, file -> fp. Idea by Alexey Tourbin.
2007-03-05 21:41:17 +01:00
Laurent MONIN
5acb3a68fb
If there is nothing to write do not even open the file for write (test
...
formdata length). Patch by Alexey Tourbin.
2007-03-05 21:37:24 +01:00
Laurent MONIN
edb8d9001c
If there is nothing to write do not even open the file for write. Patch
...
by Alexey Tourbin.
2007-03-05 21:34:45 +01:00
Laurent MONIN
4b9ddf1481
Take care of fwrite() and fclose() return values. Patch by Alexey Tourbin.
2007-03-05 21:30:16 +01:00
Laurent MONIN
6bdc34cfbc
Unlink file on error. Patch by Alexey Tourbin.
2007-03-05 21:24:02 +01:00
Laurent MONIN
0a8b52282c
formfd -> fd, formfile -> fp, formfilename -> filename. Idea by Alexey
...
Tourbin.
2007-03-05 21:17:09 +01:00
Laurent MONIN
31865ef953
Fix gcc warning: value computed is not used. Patch by Alexey Tourbin.
2007-03-05 21:11:19 +01:00
Laurent MONIN
278dec0664
Fix gcc warning: value computed is not used. Patch by Alexey Tourbin.
2007-03-05 21:10:02 +01:00
Kalle Olavi Niemitalo
9f47368894
fsp: Try to support large files.
...
FSP v2 uses 32-bit file offsets in its UDP packets and cannot get past
4 GiB. ELinks should however try not to wrap the numbers to negative
at 2 GiB, if it is built with large file support.
2007-03-05 22:09:17 +02:00
Kalle Olavi Niemitalo
1d0a3e9f7c
fsp: Call fsp_closedir also if protocol.fsp.sort is true.
2007-03-05 22:01:22 +02:00
Kalle Olavi Niemitalo
0eb0f05b35
fsp: Don't call decode_uri(NULL). It will crash.
2007-03-05 21:59:34 +02:00
Kalle Olavi Niemitalo
97edc3a2cc
fsp: Don't call qsort with a NULL pointer.
2007-03-05 21:36:36 +02:00
Kalle Olavi Niemitalo
f1d400ab3e
fsp: Use copy_struct rather than memcpy.
2007-03-05 21:27:32 +02:00
Kalle Olavi Niemitalo
bb79836cb7
fsp: HTML-encode file names in the directory listing.
2007-03-05 21:24:25 +02:00
Kalle Olavi Niemitalo
380deb2c1d
fsp: Comment about not calling fsp_close_session on error.
2007-03-05 21:21:26 +02:00
Kalle Olavi Niemitalo
95a377e81b
fsp: Remove a cast.
2007-03-05 20:51:38 +02:00
Kalle Olavi Niemitalo
23b4b912ac
fsp: Assert that there is room for a terminating null.
2007-03-05 20:50:27 +02:00
Kalle Olavi Niemitalo
368a749123
fsp: Comment about not freeing memory in the child process.
2007-03-05 20:48:17 +02:00
Kalle Olavi Niemitalo
3ba31763a9
fsp: Call close_socket(socket) rather than close(socket->fd).
2007-03-05 20:46:15 +02:00
Kalle Olavi Niemitalo
fb184a4cd0
fsp: prompt_username_pw is in the parent process.
2007-03-05 20:21:24 +02:00
Kalle Olavi Niemitalo
1ad016bdd5
fsp: Comment and FIXME about closing file descriptors.
2007-03-05 20:20:04 +02:00