Commit Graph

20 Commits

Author SHA1 Message Date
8a93319b47 Rename strlcpy to wget_strlcpy
* include/wget/wget.h: Rename and remove gnulib deps.
* libwget/strlcpy.c: Rename function and fall back to strlcpy.
* */*.c: Rename strlcpy to wget_strlcpy.
2017-05-02 11:36:51 +02:00
c6ee3d79ad Fix syntax-check 'sc_prohibit_have_config_h'
* cfg.mk: Remove sc_prohibit_have_config_h from local-checks-to-skip
* libwget/*.c: Include <config.h> unconditionally
* src/*.c: Likewise
* tests/*.c: Likewise
2017-04-30 22:01:34 +02:00
f11f45d1ef * libwget/html_url.c (_css_parse_uri): Fix -Wunused-param 2017-04-13 20:07:12 +02:00
6214291e3b Fixed crash in convert-links code introduced with html css parsing
* include/wget/wget.h: Removed unused variable.
* libwget/html_url.c: Updated code to always return pointer inside "html" variable.
* test/test-k.c: Updated test to cover the bug.
2017-04-13 19:58:10 +02:00
a0095d69ec * libwget/html_url.c: Remove empty _css_parse_encoding() 2017-04-13 12:35:56 +02:00
1a574dcff0 * libwget/html_url.c: Remove some trailing whitespaces 2017-04-13 10:14:28 +02:00
31762cc633 Added support for html css style tag and attribute
* include/wget/wget.h: Add 'size_t len' to wget_css_parse_buffer()
  and wget_css_get_urls()
* libwget/css.c (wget_css_parse_buffer): Use yy_scan_bytes() instead
  of yy_scan_string()
* libwget/css_url.c: Add param to wget_css_get_urls() and
  wget_css_parse_buffer()
* libwget/html_url.c: Add _css_parse_encoding() and _css_parse_uri(),
  (_html_get_url): Deal with 'style' attribute,
  (wget_html_free_urls_inline): Free url if needed
* libwget/test_linking.c: Add param to wget_css_parse_buffer()
* libwget/xml.c (parseXML): Add check for 'style'
* src/wget.c (css_parse): Add param 'size_t len'
* tests/Makefile.am: Add new test test-parse-html-css
* tests/test-parse-html-css.c: New file
2017-04-13 10:06:25 +02:00
dd2f4b50e9 Follow link:rel=preload with --page-requisites
* libwget/html_url.c (_html_get_url): Add rel=preload to be followed
* tests/test--page-requisites.c: Add a test href for rel=preload
2017-04-12 16:34:11 +02:00
a83becf4de Fix --page-requisites <link> handling
* libwget/html_url.c: Add helper ctx->uri_index,
  fix "icon shortcut" -> "shortcut icon",
  fix check for "stylesheet"
* src/wget.c (html_parse): Check for !html_url->link_inline
* tests/test--page-requisites.c: Add 'not.txt' URL and reference
2017-04-12 16:14:39 +02:00
e7a982f799 * libwget/html_url.c (_html_get_url): Fix commented info_printf line 2017-03-21 10:32:11 +01:00
ec396c577f Fix URLs to HTTPS where possible 2017-02-28 15:31:30 +01:00
7fd917e94e Exclude some URLs from recursive download with -p.
* include/wget/wget.h: Add link_inline to WGET_HTML_PARSED_URL
* libwget/html_url.c: Add link_inline to _html_context_t,
  (_html_get_url): Set ctx->link_inline
* src/wget.c (html_parse): Exclude action and formaction URLs,
  exclude certain 'link' URLs from download
2017-02-28 11:35:09 +01:00
9568b0c87e Rename include/libwget.h to include/wget/wget.h+wgetver.h 2016-09-30 09:47:32 +02:00
0ff0a43600 Add support for HTML5 srcset attribute in IMG tags
* libwget/html_url.c: Add scanning srcset values
* tests/test--page-requisites.c: Add srcset test cases
2016-03-01 11:08:42 +01:00
dd3c2f63b2 Updated copyright year for all relevant files 2016-01-25 13:06:21 +01:00
dbc9e54a24 Use c-ctype.h where possible
* libwget/atom_url.c, libwget/buffer_printf.c, libwget/css.c,
  libwget/html_url.c, libwget/http.c, libwget/rss_url.c, libwget/sitemap_url.c,
  src/options.c src/wget.c, tests/libtest.c, tests/test-parse-html.c:
  Use c-ctype.h where possible
2016-01-13 11:34:31 +01:00
1e8c3848d0 Call wget_str(n)casecmp_ascii instead of str(n)casecmp
* examples/print_css_urls2.c, libwget/cookie.c, libwget/css.c,
  libwget/html_url.c, libwget/http.c, libwget/iri.c, libwget/metalink.c,
  libwget/net.c, libwget/robots.c, libwget/ssl_gnutls.c,
  libwget/stringmap.c, libwget/xml.c, src/job.c, src/options.c, src/wget.c:
  Call wget_str(n)casecmp_ascii instead of str(n)casecmp
2016-01-11 16:26:25 +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