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:
William Melody 2015-09-12 15:03:09 -07:00
parent b8811d42ba
commit 1d1fa7ce9f
1 changed files with 1 additions and 1 deletions

2
hosts
View File

@ -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}\)$"