1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-16 01:08:31 -04:00
Commit Graph

212 Commits

Author SHA1 Message Date
Kalle Olavi Niemitalo
f02e471762 const in decode_color 2008-01-26 17:53:14 +02:00
Kalle Olavi Niemitalo
3f508a9803 const in fastfind_search 2008-01-26 17:52:22 +02:00
Miciah Dashiel Butler Masters
13523248ed Merge commit 'origin/elinks-0.12'
Conflicts:

	po/fr.po
	src/document/dom/renderer.c
	src/document/html/parser.c
	src/document/options.c
	src/document/refresh.c
2007-10-09 14:05:03 +00:00
Kalle Olavi Niemitalo
e2cc0bd434 Don't cast qsort comparison function pointers.
Instead, convert the element pointers inside the comparison functions.

The last argument of qsort() is supposed to be of type
int (*)(const void *, const void *).  Previously, comp_links() was
defined to take struct link * instead of const void *, and the type
mismatch was silenced by casting the function pointer to void *.
This was in principle not portable because:

(1) The different pointer types may have different representations.
    In a word-oriented machine, the const void * might include a byte
    selector while the struct link * might not.

(2) Casting a function pointer to a data pointer can lose bits in some
    memory models.  Apparently this does not occur in POSIX-conforming
    systems though, as dlsym() would fail if it did.

This commit also fixes hits_cmp() and compare_dir_entries(), which
had similar problems.  However, I'm leaving alias_compare() in
src/intl/gettext/localealias.c unchanged for now, so as not to diverge
from the GNU version.

I also checked the bsearch() calls but they were all okay, apart from
one that used the alias_compare() mentioned above.
2007-10-06 23:05:05 +03:00
Laurent MONIN
b389d1b20e Revert "Use the new OBJS-unless$(CONFIG_FOO) instead of $(call not,...)"
This reverts commit e07354f5d5.
2007-09-14 17:43:36 +02:00
Jonas Fonseca
e07354f5d5 Use the new OBJS-unless$(CONFIG_FOO) instead of $(call not,...) 2007-09-14 16:48:26 +02:00
Laurent MONIN
6c6e75a71d Trim trailing whitespaces. 2007-09-14 15:14:34 +02:00
Laurent MONIN
f0e66866f5 Trim trailing whitespaces. 2007-09-14 15:12:32 +02:00
Laurent MONIN
ee503f6c00 Prevent internal errors when terminal width or height are very small
(1x1 was fatal).
2007-09-14 11:49:03 +02:00
Jonas Fonseca
0240c469b7 Merge branch 'elinks-0.12'
Conflicts:

	src/document/dom/renderer.c
2007-09-09 18:25:49 +02:00
Kalle Olavi Niemitalo
af14d00d17 Add missing va_ends.
I'm not sure they're needed anywhere nowadays, but still.
2007-09-03 21:01:11 +03:00
Miciah Dashiel Butler Masters
0e0bacf0d3 Merge branch 'master' of ssh://pasky.or.cz/srv/git/elinks
Conflicts:

	src/document/options.c
2007-08-30 21:13:43 +00:00
Jonas Fonseca
af4b7bed84 Use the new OBJS-unless$(CONFIG_FOO) instead of $(call not,...) 2007-08-29 01:57:01 +02:00
Jonas Fonseca
bbd7c8354a Move get_test_opt to util/test.h and use throughout test programs 2007-08-28 20:34:17 +02:00
Jonas Fonseca
0f53941fef Introduce test library in util/test.h containing the die() function
Fix the die() function to exit with EXIT_FAILURE value as pointed
out by Kalle on elinks-dev in <87tzqkxhlp.fsf@Astalo.kon.iki.fi>.
2007-08-28 20:14:08 +02:00
Miciah Dashiel Butler Masters
ea372bd0cd get_opt_*: Add ses parameter
Add a session parameter to get_opt_ and its wrappers in preparation for session-specific and domain-specific options.
2007-08-28 17:24:59 +00:00
Miciah Dashiel Butler Masters
3975d28bce Merge commit 'origin/elinks-0.12'
Conflicts:

	doc/Doxyfile.in
	src/protocol/bittorrent/common.h
2007-08-28 14:47:39 +00:00
Kalle Olavi Niemitalo
76c6f38169 Doxygen: Begin commands with @ not \. 2007-07-31 13:47:12 +03:00
Kalle Olavi Niemitalo
778996d725 Doxygen: expand INIT_LIST_OF 2007-07-29 12:55:25 +03:00
Kalle Olavi Niemitalo
2437d35904 Merge commit 'pasky.or.cz/elinks-0.12' into elinks-0.13
There were conflicts in src/document/css/ because 0.12.GIT switched
to LIST_OF(struct css_selector) and 0.13.GIT switched to struct
css_selector_set.  Resolved by using LIST_OF(struct css_selector)
inside struct css_selector_set.
2007-07-28 03:22:29 +03:00
Kalle Olavi Niemitalo
54dfa64c04 Doxygen: @relates 2007-07-27 14:14:00 +03:00
Kalle Olavi Niemitalo
e530fbe8e2 Doxygenate src/util/ 2007-07-27 13:10:50 +03:00
Kalle Olavi Niemitalo
96176a8c77 Declare element types of lists. 2007-07-26 22:47:23 +03:00
Kalle Olavi Niemitalo
d3d2bb26c5 New macro LIST_OF for better Doxygen support. 2007-07-26 22:45:51 +03:00
Kalle Olavi Niemitalo
eccc8c23f0 Merge with http://elinks.cz/elinks.git#elinks-0.12 2007-07-09 16:03:06 +03:00
Jonas Fonseca
8bfab2242e Fix 'make test' dependency when building test utility programs
Problems was caused by undefined symbols:

	src/util/conv.c:308: undefined reference to `is_cp_utf8'
	src/util/conv.c:320: undefined reference to `cp2u'
2007-05-26 13:46:12 +02:00
Laurent MONIN
3ae299c3ca Prevent internal errors when terminal width or height are very small
(1x1 was fatal).
2007-04-27 17:55:12 +02:00
Laurent MONIN
0b98c5051b Fix trailing whitespaces 2007-04-26 15:02:04 +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
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
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
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
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
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
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
ab92c38ca2 add_html_to_string: Let src (aka html) point to const. 2007-03-05 19:35:29 +02:00
Witold Filipczyk
f2a3983389 Limit the timeout to one second only under Windows. 2007-01-28 18:29:14 +02:00
Kalle Olavi Niemitalo
5367209702 mem_align_alloc__, add_bytes_to_string__: Let file point to const. 2007-01-28 02:12:39 +02:00
Kalle Olavi Niemitalo
fd27919f91 add_format_to_string: Let format point to const. 2007-01-28 02:05:52 +02:00
Kalle Olavi Niemitalo
a4293ed606 string_concat: Assume all variadic arguments point to const. 2007-01-28 02:04:00 +02:00
Kalle Olavi Niemitalo
66614acbc0 add_file_to_string: Let filename point to const. 2007-01-28 01:50:06 +02:00
Kalle Olavi Niemitalo
f47bdd76d6 init_string__: Let the file parameter point to const. 2007-01-28 01:46:30 +02:00
Kalle Olavi Niemitalo
0ba497b0d4 xstrcmp: Make both parameters point to const. 2007-01-28 01:43:49 +02:00
Kalle Olavi Niemitalo
0ee76a0ef3 straconcat: Assume all arguments point to const. 2007-01-28 01:42:08 +02:00
Kalle Olavi Niemitalo
03ccf0b2b1 add_to_strn: Let the src parameter point to const. 2007-01-28 01:39:45 +02:00
Kalle Olavi Niemitalo
ac339cf5e5 elinks_ulongcat: Make the static strings const.
And simplify an expression to avoid a cast.
2007-01-28 01:28:44 +02:00
Kalle Olavi Niemitalo
ada3858372 color_specs: Make const. 2007-01-28 01:13:53 +02:00
Kalle Olavi Niemitalo
0484f68b69 get_color_string: Return a pointer to const. 2007-01-28 00:52:21 +02:00
Kalle Olavi Niemitalo
add2a5d1b5 add_quoted_to_string: Make the src parameter point to const. 2007-01-28 00:20:59 +02:00
Kalle Olavi Niemitalo
f4709c3794 Bug 882: Replace C1 controls with spaces in UTF-8 to the terminal. 2007-01-27 11:12:22 +02:00
Kalle Olavi Niemitalo
649f470fe5 add_string_to_string: Make the "from" string const. 2007-01-25 00:33:17 +02:00
Kalle Olavi Niemitalo
3b7c021254 Comment changes only (about charsets in terminals). 2007-01-24 23:11:17 +02:00
Kalle Olavi Niemitalo
01fdf6c4d3 Bug 923: Added comments about potential time_t truncation.
And removed Miciah's portability question; MSVC++2005 already
has a time_t longer than long, so assuming that time_t is long
is surely not portable.
2007-01-13 15:26:21 +02:00
Kalle Olavi Niemitalo
f0dfd0504f Route time_t-to-string conversions via time_print_T and TIME_PRINT_FORMAT.
The previous code just printed time_t directly with "%ld".  Now it
instead first casts to time_print_T (currently long) and then formats
with TIME_PRINT_FORMAT (currently "ld").  So the varargs will now
always match with the format string, even if time_t is longer than
long.  This still doesn't correctly format time_t values larger than
LONG_MAX, though.  But now it is at least easier to find some of the
places that need to be changed to support that.

I located these time_t-to-string conversions by searching for
str_to_time_t, expires, and last_visit.  There are still more places
that assume every interesting time_t value fits either in 32 bits or
in a long, e.g. in the cookie editor and in the ECMAScript interface.

Inspired by bug 6.
2007-01-12 23:47:45 +02:00
Kalle Olavi Niemitalo
176bbe83b6 Make input data and source file names const in memacpy and stracpy. 2007-01-02 21:26:55 +02:00
Kalle Olavi Niemitalo
882d179fc8 Make many string parameters const in the memory leak detector. 2007-01-02 21:25:20 +02:00
Kalle Olavi Niemitalo
251dcb7f9f Make errfile point to const. 2007-01-02 21:22:51 +02:00
Kalle Olavi Niemitalo
068663783c insert_in_string: Let the seq parameter point to const.
It is the data to be inserted into the other string.
2007-01-02 00:47:38 +02:00
Kalle Olavi Niemitalo
4ae90c798c Bug 919, mem_mmap_realloc: Don't overflow the buffer when shrinking it.
The bug was possible only #ifndef HAVE_MREMAP, thus not on Linux.
2006-12-31 09:49:13 +02:00
Kalle Olavi Niemitalo
47a2fc19e1 Bug 887: New function secsave_strerror.
Extracted from write_config_dialog.
2006-12-09 18:14:28 +02:00
Miciah Dashiel Butler Masters
7f0fb0440c Secure file saving: restore umask after _all_ failure conditions
The secure file saving code plays some shenanigans with the umask.
Previously, the code could fail to restore the old umask when certain libc
calls failed: malloc, mkstemp, fdopen, and fopen. This resulted in
unrelated code creating files with the wrong umode. Specifically, the
download code's automatic directory creation was creating directories
without the execute permission bit.

Thanks to Quiznos for reporting and helping to track the problem down.
2006-10-01 14:57:47 +00:00
Kalle Olavi Niemitalo
e2685ae7b2 New function colspan_is_in_box() 2006-09-02 21:48:19 +03:00
Laurent MONIN
b373ded19b Trim trailing whitespaces. 2006-06-14 14:46:30 +02:00
Laurent MONIN
4b04a25b32 Support for negotiate-auth, using GSSAPI. It makes possible to
authenticate users by Kerberos. Patch by Karel Zak.
2006-06-14 14:41:59 +02:00
Laurent MONIN
5acb5e6663 Trim trailing whitespaces. 2006-05-31 19:34:49 +02:00
Laurent MONIN
1d3656a317 Pass a pointer to a hash pointer to free_hash() to ensure hash pointer
is NULL on return.
2006-05-31 19:33:36 +02:00
Laurent MONIN
54099f5286 Do not export init_hash(),strhash() and hash_size() anymore, use a
wrapper named init_hash8() instead.
2006-05-31 19:17:01 +02:00
Witold Filipczyk
cbb507a6b5 WIN32 port: introduced VT100 decoder. ELinks is able to display first page
of the document. Keyboard doesn't work, Windows style path either.
I tested it only under Wine.
2006-05-20 14:05:45 +02:00
Witold Filipczyk
3dc145bde2 Changes related to Win32 port. S_IRWXG and S_IRWXO were undefined
under crossmingw32. init_static_version must be called after init_options
because ELinks wanted to read "verbose" option before it was initialized.
2006-05-18 21:46:42 +02:00
Witold Filipczyk
043939806d Redefined buggy isdigit. ELinks built with tcc works 2006-04-05 23:35:04 +02:00
Miciah Dashiel Butler Masters
190259ca22 mem_alloc_align: drop the obj type parameter
Instead use the object itself, i.e., replace typeof(obj) with
typeof(**ptr).
2006-02-17 17:32:59 +00:00
Laurent MONIN
b99f5c4b9f Include <sys/types.h> and fix compilation on an old PPC/Debian system
It should be included via elinks.h but apparently some other system header
can prevent this somehow on some systems.

Reported-by: Phillip Pi <ant@zimage.com>
2006-02-01 11:34:07 +01:00
4aaafc4716 Inroduced garbage collector. Disabled by default 2006-01-30 22:09:13 +01:00
Jonas Fonseca
384a2d66e5 Fix inclusion of header files after CONFIG_{MD5,SHA1} were removed
Fixes: 206037eaa4
2006-01-21 08:44:19 +01:00
Jonas Fonseca
cbee566144 Increase the max length of filenames to 15 for the LOG_* system 2006-01-19 04:25:11 +01:00
Jonas Fonseca
206037eaa4 Handle the logic for util/{md5,sha1} in the Makefile 2006-01-19 02:08:07 +01:00
Jonas Fonseca
359d835050 Handle the logic for util/scanner in the Makefile; less CONFIG_* variables 2006-01-19 01:24:42 +01:00
Laurent MONIN
3133db3474 Use elinks_ulongcat() instead of snprintf(). 2006-01-17 01:18:45 +01:00
Laurent MONIN
864745b55e Make 8-bytes buffer more obvious. 2006-01-17 00:48:25 +01:00
Jonas Fonseca
2748d043f9 Autogenerate .vimrc files and put the master in config/vimrc
This changes the init target to be idempotent: most importantly it will now
never overwrite a Makefile if it exists. Additionally 'make init' will
generate the .vimrc files. Yay, no more stupid 'added fairies' commits! ;)
2006-01-15 18:38:58 +01:00
Jonas Fonseca
af564bb101 Fix typo 2006-01-14 08:24:11 +01:00
Laurent MONIN
202965d338 CONFIG_WIN32 -> CONFIG_OS_WIN32 2006-01-11 20:10:27 +01:00
Laurent MONIN
b6ccfc0e07 CONFIG_OS2 -> CONFIG_OS_OS2 2006-01-11 20:10:26 +01:00
Laurent MONIN
b8e64a5ee0 Simplify secure_open() call, make it a wrapper around secure_open_umask(). 2006-01-10 23:49:35 +01:00
Laurent MONIN
151bcbd3a2 Prefer S_I?USR and S_IRWXU over obsolete S_IREAD, S_IWRITE, S_IEXEC. 2006-01-10 23:40:39 +01:00
Laurent MONIN
9b88da873a Use mode_t and mode macros everywhere. 2006-01-10 23:35:22 +01:00
Kalle Olavi Niemitalo
7c80c67759 Don't include <sys/param.h> in util/math for MAX/MIN
<sys/param.h> includes <linux/param.h>, which includes <asm/param.h>, which
includes <asm-i486/param.h>, which includes <linux/config.h>, which
includes <linux/autoconf.h>, which includes <asm-i486/autoconf.h>, which
undefines CONFIG_IPV6.
2006-01-09 02:09:59 +01:00
Laurent MONIN
9dc2a7ffb7 Merge code from create_bittorrent_path() and mkalldirs(). Suggested by
Jonas. Simpler and better.
2006-01-05 10:49:05 +01:00
Laurent MONIN
73a99b6b99 Introduce functions to make directories, partly borrowed to wget. Not
yet used.
2006-01-04 21:43:42 +01:00
Laurent MONIN
2a71adda10 Revert
http://cvsweb.elinks.cz/cvsweb.cgi/elinks/src/util/file.c.diff?r1=1.44;r2=1.45
patch, which has to be reworked, without modifying file_exists().
2006-01-04 21:41:56 +01:00
Laurent MONIN
4ced25779d Add missing b flag to fopen() call. 2006-01-01 23:47:34 +01:00
Jonas Fonseca
3d0fc33785 set_mem_comment(): Use memcpy() + NUL assignment instead of safe_strncpy()
... so as not to depend on util/string stuff.
2005-12-28 23:06:23 +01:00
Miciah Dashiel Butler Masters
a33547d8ad Add memory-leak tracing to intdup. 2005-12-26 11:22:05 +00:00
Miciah Dashiel Butler Masters
1602bd5d29 Factor intdup out of smjs_get_keymap_object. 2005-12-26 11:07:15 +00:00
Miciah Dashiel Butler Masters
517bb03da4 Add routine add_file_to_string and use it in load_textarea_file. 2005-12-18 15:56:59 +00:00
Jonas Fonseca
5dffe2e8ac Fix various sparse warnings
Mostly non-ANSI function declarations, using 0 as NULL and inline
function prototypes. Also removed unused S_HTTP_100 network state
enum type, which text message contained unknown escape sequence: '\?'.
2005-11-24 15:38:47 +01:00
Jonas Fonseca
acf2ec806b Remove empty lines in start of header files
A left over from the CVS Id removal. Also, for a few files, normalize the
order in which things are declared in headers.
2005-11-15 11:33:27 +01:00
Laurent MONIN
df065ead80 Remove now useless $Id: lines. 2005-10-21 09:14:07 +02:00
Jonas Fonseca
c88afeb1c2 path_to_top -> top_builddir 2005-10-20 04:00:35 +02:00
Jonas Fonseca
e39a4342d6 Include $(top_srcdir)/Makefile.lib instead of $(path_to_top)/Makefile.lib
A step towards out of tree builds ...
2005-10-20 01:11:47 +02:00
Marti Raudsepp
e31a66745a Fix a bug in the KiB and MiB computation in add_xnum_to_string
where the fractional part overflowed to 0 before the integer part
was incremented.

Thanks to Marti Raudsepp for finding this bug and Marti and pasky
for the fix.
2005-10-16 01:53:06 +00:00
Jonas Fonseca
94ed6fa754 Finalize and cleanup the denser Makefile format
Convert remaining conditional file building to use

	OBJS-$(CONFIG_FOO) += foo.o

one problem with reverse meaining (in util/) fixed with local 'hack'.

Cleanup and remove stuff which is now default targets.
2005-09-28 12:38:17 +02:00
Jonas Fonseca
1efab31581 Simplify building of and linking with directories
Ditch the building of an archive (.a) in favour of linking all objects in a
directory into a lib.o file. This makes it easy to link in subdirectories
and more importantly keeps the build logic in the local subdirectories.

Note: after updating you will have to rm **/*.a if you do not make clean
before updating.
2005-09-27 21:38:58 +02:00
Jonas Fonseca
b30064c0d0 Rename targets: *-l -> *-local 2005-09-27 21:11:28 +02:00
Petr Baudis
18f85bec14 ELBuildized util/. 2005-09-16 13:27:27 +02:00
Jonas Fonseca
7462f22635 Remove now obsolete .cvsignore files. 2005-09-15 18:33:20 +02:00
Petr Baudis
0f6d4310ad Initial commit of the HEAD branch of the ELinks CVS repository, as of
Thu Sep 15 15:57:07 CEST 2005. The previous history can be added to this
by grafting.
2005-09-15 15:58:31 +02:00