mirror of https://github.com/rkd77/elinks.git synced 2024-07-19 15:34:27 -04:00
Commit Graph

89 Commits

Author SHA1 Message Date
Witold Filipczyk
3d96b0d7d7 Revert "Compile with C++."
This reverts commit 4f4df33638.
2019-04-21 12:27:40 +02:00
Witold Filipczyk
4f4df33638 Compile with C++.
Weak points:
- alignof
- js problems

- make js work with C++ and mozjs-17
- then mozjs-24
- then mozjs-52
- then mozjs-60
- decrease number of warnings
2019-02-17 20:46:16 +01:00
Marco Migliori
5e31308da0 text direction mark 2017-05-16 20:57:25 +02:00
Witold Filipczyk
52d6f37c8e Explicit cast to (const char *) for strchr function (C++) 2016-04-20 19:43:37 +02:00
Witold Filipczyk
67673f5fe5 new -> new_ for C++ compatibility 2016-04-20 18:42:22 +02:00
Bin Guo
7553d321a1 Fixed problem of converting more thant 256 chars. 2014-06-26 21:21:59 +02:00
7dd4d9b737 iconv: Bail out of the loop when an illegal sequence of bytes occurs.
Before, with the default codepage GB2312 and a mysql sql dump in UTF-8
I got segfaults in the iconv related code.
2013-02-27 09:33:55 +01:00
Kalle Olavi Niemitalo
f735bfbe72 I18N bug 1112: Use strange_chars[] for UTF-8 output too
Make u2cp_() map code points U+0080 to U+009F via strange_chars[] even
if the target codepage is UTF-8.  This helps with buggy web pages that
use ’ when they mean ’.  This change does not affect how
ELinks decodes raw bytes 0x80 to 0x9F in HTML.

u2cp_() is used only via the u2cp and u2cp_no_nbsp macros.
Possible side effects of this change at each use of these macros:

* get_translation_table(): Not affected because it does not call u2cp
  if the target codepage is UTF-8.
* get_entity_string(): Numeric character references are affected, as intended.
  Character entity references are not affected because entities[]
  does not define any entities in the U+0080...U+009F range.
* kbd_field(), term_send_ucs(), field_op(): Affected.  It is no longer
  possible to enter code points U+0080...U+009F from the terminal.
  This should not be a problem in practice because those would be
  control characters anyway and should therefore be filtered by the
  slave process (which doesn't yet recognize them; bug 777).
2011-04-17 21:24:26 +03:00
Witold Filipczyk
90b37ff15f Reset iconv_cp when switching from Big5 -> UTF-8 to UTF-8 -> UTF-8.
After viewing a page with Big5 charset and next a page with UTF-8
charset iconv was used, so slows down a bit.
Now iconv is used only for those charsets, which has the iconv
bitfield set.
2010-07-24 09:57:59 +02:00
Witold Filipczyk
6d567bb8ce Support for multibyte encodings using iconv.
New charsets must be added by analogy to Big5.
2010-07-23 19:59:59 +02:00
Witold Filipczyk
b50fd4e8e2 codepage_desc: added the iconv bitfield.
I'm going to use it later for multibyte encodings, such as Big5.
2010-07-23 15:44:12 +02:00
Kalle Olavi Niemitalo
683cfe4c86 Merge branch 'elinks-0.12' into elinks-0.13
	NEWS: merged
	configure.in: VERSION changed in elinks-0.12; kept 0.13.GIT
	doc/man/man1/elinks.1.in: regenerated
	doc/man/man5/elinks.conf.5: regenerated
	doc/man/man5/elinkskeys.5: regenerated
	po/fr.po: kept 0.13.GIT
	po/pl.po: kept 0.13.GIT
2009-05-31 16:18:23 +03:00
Kalle Olavi Niemitalo
6d7b904fe3 Don't overcount in utf8_step_forward
Reported by witekfl.
2009-05-27 01:11:02 +03:00
Kalle Olavi Niemitalo
34f8f6a58f Merge branch 'elinks-0.12' into master
	NEWS (merged)
	configure.in (merged)
	doc/man/man1/elinks.1.in (regenerated)
	doc/man/man5/elinks.conf.5 (regenerated)
	doc/man/man5/elinkskeys.5 (regenerated)
	po/af.po (used elinks-0.12)
	po/be.po (used elinks-0.12)
	po/bg.po (used elinks-0.12)
	po/ca.po (used elinks-0.12)
	po/cs.po (used elinks-0.12)
	po/da.po (used elinks-0.12)
	po/de.po (used elinks-0.12)
	po/el.po (used elinks-0.12)
	po/es.po (used elinks-0.12)
	po/et.po (used elinks-0.12)
	po/fi.po (used elinks-0.12)
	po/fr.po (used master)
	po/gl.po (used elinks-0.12)
	po/hr.po (used elinks-0.12)
	po/hu.po (used elinks-0.12)
	po/id.po (used elinks-0.12)
	po/is.po (used elinks-0.12)
	po/it.po (used elinks-0.12)
	po/lt.po (used elinks-0.12)
	po/nb.po (used elinks-0.12)
	po/nl.po (used elinks-0.12)
	po/pl.po (used master)
	po/pt.po (used elinks-0.12)
	po/pt_BR.po (used elinks-0.12)
	po/ro.po (used elinks-0.12)
	po/ru.po (used elinks-0.12)
	po/sk.po (used elinks-0.12)
	po/sr.po (used elinks-0.12)
	po/sv.po (used elinks-0.12)
	po/tr.po (used elinks-0.12)
	po/uk.po (used elinks-0.12)
2009-03-29 18:26:20 +03:00
Kalle Olavi Niemitalo
d7d18e4e43 bug 1047: inline functions C99 conformance
C99 6.7.4p3 and 6.7.4p6 set some constraints on what can be done in
inline functions and how they can be declared.  In particular, any
function declared inline must also be defined in the same translation
unit.  To comply with that, remove inline specifiers from function
declarations in header files when the functions are not also defined
in those header files.

Sun Studio 11 on Solaris 9 is stricter than C99 and does not allow
references to static identifiers in extern inline functions.  Make the
configure script detect this and define NONSTATIC_INLINE accordingly
in config.h.  Then use that in the definitions of all non-static
inline functions.

Document the restrictions and this scheme in doc/hacking.txt.
2009-03-28 20:15:08 +02:00
Kalle Olavi Niemitalo
d2854dca8d Merge branch 'elinks-0.12' into elinks-0.13
2009-02-08 22:02:57 +02:00
Witold Filipczyk
39c6589edb Added the get_cp_highhalf function, which will be used by xhtml. 2009-01-26 21:11:14 +01:00
Kalle Olavi Niemitalo
9088f11c64 Make encode_utf8() extern even without CONFIG_UTF8.
It will soon be needed for conversions from UTF-16 to UTF-8.
2009-01-04 16:55:24 +02:00
Kalle Olavi Niemitalo
687f19dbde Merge branch 'elinks-0.12' into elinks-0.13

And a semantic conflict in src/terminal/terminal.c.
2009-01-01 19:14:01 +00:00
Kalle Olavi Niemitalo
8f4d7f9903 Define cp_to_unicode() even without CONFIG_UTF8.
And make its last parameter point to const.  add_cp_html_to_string()
no longer needs to pretend UTF-8 is ISO-8859-1.
2009-01-01 16:17:03 +00:00
Miciah Dashiel Butler Masters
b9b2b75f73 Drop zero-initialisation of static storage
In get_entity_string and point_intersect, do not initialise arrays with
static storage duration to zero; the C standard states that such objects
are automatically initialised to zero.
2008-12-27 05:32:36 +00:00
Kalle Olavi Niemitalo
5c2fada371 Merge branch 'elinks-0.12' into elinks-0.13
2008-11-01 22:39:17 +02:00
M. Vefa Bicakci
96b3093519 Patch 2: Modifications to the remaining parts of ELinks
[Forward ported to 0.12 from bug 1004 attachment 499.  --KON]
2008-11-01 22:20:25 +02:00
Kalle Olavi Niemitalo
5499926cc0 Merge branch 'elinks-0.12' into elinks-0.13

2008-02-03 22:30:46 +02:00
Kalle Olavi Niemitalo
cb90ed94f0 const in get_cp_index 2008-02-03 14:41:35 +02:00
Miciah Dashiel Butler Masters
3a0286e447 Strings corrections from Malcolm Parsons
Fix the spelling and grammar in various comments, variable names, comment
descriptions, and documentation.
2008-01-27 04:19:23 +00:00
Miciah Dashiel Butler Masters
643a34e6af Strings corrections from Malcolm Parsons
Fix the spelling and grammar in various comments, variable names, comment
descriptions, and documentation.
2008-01-27 04:09:18 +00:00
Kalle Olavi Niemitalo
f19c948ca7 Bug 824: Disable combining characters unless --enable-combining.
Label this as an experimental feature because it has so many bugs
and it is not clear how they can be fixed.
2008-01-19 20:58:22 +02:00
Witold Filipczyk
560818568a combined: Added the option "combine" to terminal and screen driver options.
Note that, combining characters work only on XTerm with UTF-8 locale setings.
2008-01-19 20:49:47 +02: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
Kalle Olavi Niemitalo
341d54151f Debian bug 380347: Prevent a buffer overflow in entity_cache. 2007-05-01 11:23:25 +03:00
Kalle Olavi Niemitalo
da3c8c5ce2 Bugs 879, 928, 947: Specially map U+00A0 and U+00AD in translation tables. 2007-04-26 21:39:46 +03:00
Kalle Olavi Niemitalo
70dc594d93 Bug 879: New constant UCS_SOFT_HYPHEN; use where applicable. 2007-04-22 22:38:40 +03:00
Kalle Olavi Niemitalo
9d6c0b13e8 Bug 879, u2cp_: Use UCS_NO_BREAK_SPACE instead of 0xa0. 2007-04-22 22:37:12 +03: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
2ac31b6144 utf8_to_unicode: Let the end parameter point to const. 2007-03-18 20:13:15 +02: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
ae5fe80100 Document that NBSP_CHAR is not used in UTF-8 strings. 2007-01-29 20:57:37 +02:00
Kalle Olavi Niemitalo
a577455b24 Revise comments in struct codepage_desc and struct conv_table. 2007-01-03 07:32:00 +02:00
Kalle Olavi Niemitalo
455ea77ead Make strings[] and no_str[] const. 2007-01-02 21:40:14 +02:00
Kalle Olavi Niemitalo
1668d78998 Make cp2utf8 return a pointer to const. 2007-01-02 21:39:34 +02:00
Kalle Olavi Niemitalo
62d321fb31 Make add_utf8 accept a pointer to const. 2007-01-02 21:36:03 +02:00
Kalle Olavi Niemitalo
ef96caad01 Make u2cp and u2cp_no_nbsp return a pointer to const. 2007-01-02 20:08:59 +02:00
Kalle Olavi Niemitalo
712803bbeb Make entity_cache.result point to const. 2007-01-02 20:08:25 +02:00
Kalle Olavi Niemitalo
d314348e92 Make get_entity_string return a pointer to const. 2007-01-02 08:29:08 +02:00
Kalle Olavi Niemitalo
83f753f750 conv_table.u.str points to const. 2007-01-02 01:31:22 +02:00
Kalle Olavi Niemitalo
2434c180f2 Make no_str in charsets.c an array rather than a pointer variable.
This ensures that no other string can have the same address.  It
probably never was a problem though, because the strings to which it
can be compared either are allocated from the heap or are in
strings[][] which already has unshared storage.
2007-01-02 01:07:57 +02:00
Kalle Olavi Niemitalo
161b46a479 Make table[] in charsets.c static.
There is no extern declaration for it anywhere.
2007-01-02 00:58:38 +02:00
Kalle Olavi Niemitalo
9d14ea4e5a Document some variables in charsets.c. 2007-01-02 00:54:14 +02:00
Kalle Olavi Niemitalo
e45f5a8915 utf8char_len_tab[] is const.
This change moves 256 bytes of data into a read-only section, perhaps
reducing memory consumption when multiple ELinks processes run in parallel.
2007-01-01 17:18:05 +02:00