Skip to content

Added --convert-file-only handling

Archit Pandey requested to merge archit-p/wget2:add-convert-file-only into master

This merge request closes #438 (closed)

Design

  • The variable bool convert_file_only was added to struct config.
  • config.convert_file_only is checked while parsing html files for links
  • new function static void convert_file_only was added to src/wget.c.
    • design borrowed from static void convert_links
    • finds the filenames part of the local file and the linked file, if there's a difference it updates the linked file.

Test-Case

  • tests/test-convert-file-only.c checks for whether a updated local filename with option -E is reflected in the linked file when using --convert-file-only.

Possible Flaws

  • There is currently no check in the code to ensure only one of --convert-file-only or --convert-links are used.
  • Test case might be very limited. (are use-cases for --convert-file-only also limited?)

References

https://lists.gnu.org/archive/html/bug-wget/2015-06/msg00043.html

Approver's checklist:

  • The author has submitted the FSF Copyright Assignment and is listed in AUTHORS
  • There is a test suite reasonably covering new functionality or modifications
  • Function naming, parameters, return values, types, etc., are consistent with existing code
  • This feature/change has adequate documentation added (if appropriate)
  • No obvious mistakes / misspelling in the code
Edited by Archit Pandey

Merge request reports