[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-wget] Hyphens in command name (init.c) / option data (main.c)
From: |
Jeffery To |
Subject: |
[Bug-wget] Hyphens in command name (init.c) / option data (main.c) |
Date: |
Thu, 4 Aug 2016 17:38:22 +0800 |
Hi,
I'm trying to set the hsts-file option from a wgetrc file, but Wget (1.17.1
on Ubuntu 16.04 x86_64) tells me it is an unknown command. (The same option
passed on the command line yields no errors.)
I looked into the source (albeit a very cursory examination), and it
appears that in init.c (run_wgetrc), the command name is taken from each
line of the wgetrc file (parse_line), hyphens and underscores are removed
from the name (dehyphen), and then searched for in the commands array
(command_by_name).
Currently, the name for the hsts-file option in the commands array is
"hsts-file" (note the included hyphen), and so it would be impossible to
match this command from a wgetrc file. (There are several other commands
that have hyphens in their names in the commands array, e.g.
"if-modified-since" and several Metalink options, which I would expect to
also suffer from this issue, though I haven't tested them individually.)
Is this analysis correct, and if so, would a patch that removes the hyphens
from command names (and from the corresponding data field in the
option_data array in main.c) be acceptable?
Thanks,
Jeff
- [Bug-wget] Hyphens in command name (init.c) / option data (main.c),
Jeffery To <=