Commit Graph

13 Commits

Author SHA1 Message Date
165cfa20fb Mark some functions as pure
* libwget/cookie.c (_compare_cookie{,2}): Mark as pure
* libwget/encoding.c (_utf8_is_valid): Same
* libwget/hsts.c (_compare_hsts): Same
* libwget/ocsp.c (_compare_ocsp): Same
* libwget/netrc.c (_compare_netrc): Same
* libwget/tls_session.c (_compare_tls_session): Same
2016-09-30 14:48:08 +02:00
9568b0c87e Rename include/libwget.h to include/wget/wget.h+wgetver.h 2016-09-30 09:47:32 +02:00
4597de60d2 * libwget/encoding.c (wget_memiconv): Fix memleak
Reported-by: Coverity
2016-09-14 12:54:38 +02:00
7d63e876ed * libwget/encoding.c: Use ICONV_CONST to avoid cc warning 2016-09-09 17:10:54 +02:00
483c304aef Support parsing of UTF-16 HTML documents
* examples/print_html_urls.c (html_parse_localfile):
  Detect BOM (Byte Order Mark), convert UTF-16 to UTF-8 before parsing.
* include/libwget.h.in: Remove wget_charset_transcode(),
  add wget_memiconv() and wget_striconv().
* libwget/encoding.c: Implement wget_memiconv() and wget_striconv()
* src/wget.c (html_parse): Add 'html_len' param,
  convert UTF-16 to UTF-8 before parsing.
* tests/test.c: New test for wget_memiconv().
2016-04-24 15:08:20 +02:00
857ea9de85 * libwget/encoding.c: Use '#ifdef WITH_LIBIDN' instead of '#if' 2016-02-06 21:40:09 +01:00
dd3c2f63b2 Updated copyright year for all relevant files 2016-01-25 13:06:21 +01:00
33697e17df Add gnulib module langinfo
* autogen.sh: Add gnulib module langinfo
* configure.ac: Remove searching for stringprep.h and langinfo.h
* libwget/encoding.c: Remove conditional code
2016-01-12 16:31:29 +01:00
14a3c0f806 Fix OpenSolaris libidn include directory
* configure.ac: Search for idn/idna.h
* libwget/encoding.c: Include idn/idna.h if found
2016-01-09 19:32:27 +01:00
e168584d02 Fix iconv conversion
* libwget/encoding.c: Kick out the last character from iconv().

Thanks to Eli Zaretskii <eliz@gnu.org> for suggesting the fix.
Reported-by: "Andries E. Brouwer" <Andries.Brouwer@cwi.nl>
2015-12-15 10:47:16 +01:00
18bdc20576 Replaced strndup() by wget_strmemdup()
* examples/getstream.c, examples/print_css_urls2.c, libwget/cookie.c,
  libwget/css_url.c, libwget/encoding.c, libwget/hsts.c,
  libwget/html_url.c, libwget/http.c, libwget/metalink.c,
  libwget/ocsp.c, libwget/robots.c, libwget/ssl_gnutls.c,
  src/options.c, src/wget.c, tests/stringmap_perf.c,
  tests/test-wget-1.c

Strndup() calls an additional strlen() on the input string.
This is normally not needed, and thus just consumes CPU cycles.
All calls to strndup() could be replaced by wget_strmemdup, which
basically allocates len+1 memory, calls memcpy and terminates with
a 0 byte.
2015-11-10 10:55:30 +01:00
0f8e49128a Transfer copyright to Free Software Foundation, Inc. 2015-09-22 11:50:06 +02:00
c6b0e461a1 Transform Mget into Wget 2015-09-19 22:54:38 +02:00