mirror of https://github.com/octoleo/hosts.git
Match IP at start of line in `disable`
The `disable` regular expressions avoid matching against commented lines by excluding '#' characters at the beginning of the line. However, the IP portion of the record is at the beginning of non-commented lines, so in order to match these IPs the `target_regex_ip` needs to have the search term checked against the beginning of the line. Therefore, the `[^#]` at the beginning of `target_regex_ip` must be removed to make `search_term` properly match these IPs.
This commit is contained in:
parent
b8811d42ba
commit
1d1fa7ce9f
2
hosts
2
hosts
|
@ -731,7 +731,7 @@ disable() {
|
|||
else
|
||||
_debug printf "disable() \$search_term: %s\n" "$search_term"
|
||||
|
||||
target_regex_ip="^\([^#]${search_term}[${_TAB_SPACE_}]..*\)$"
|
||||
target_regex_ip="^\(${search_term}[${_TAB_SPACE_}]..*\)$"
|
||||
target_regex_commented_domain="^\([^#]..*[${_TAB_SPACE_}]${search_term}[${_TAB_SPACE_}]..*\)$"
|
||||
target_regex_domain="^\([^#]..*[${_TAB_SPACE_}]${search_term}\)$"
|
||||
|
||||
|
|
Loading…
Reference in New Issue