Skip to content

Commit

Permalink
Only delete lines containing separator when preceded by a letter to r…
Browse files Browse the repository at this point in the history
…educe false positiv (deleting valid comments)

Signed-off-by: Christian König <ckoenig@posteo.de>
  • Loading branch information
yubiuser committed Apr 8, 2023
1 parent d10d593 commit dd3a7a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gravity.sh
Expand Up @@ -770,7 +770,7 @@ gravity_ParseFileIntoDomains() {
# 2) Remove carriage returns
# 3) Remove lines starting with ! (ABP Comments)
# 4) Remove lines starting with [ (ABP Header)
# 5) Remove lines containing ABP extended CSS selectors ("##", "#!#", "#@#", "#?#")
# 5) Remove lines containing ABP extended CSS selectors ("##", "#!#", "#@#", "#?#") preceded by a letter
# 6) Remove comments (text starting with "#", include possible spaces before the hash sign)
# 7) Remove leading tabs, spaces, etc. (Also removes leading IP addresses)
# 8) Remove empty lines
Expand All @@ -779,7 +779,7 @@ gravity_ParseFileIntoDomains() {
-e 's/\r$//' \
-e 's/\s*!.*//g' \
-e 's/\s*\[.*//g' \
-e '/\#[$?@]{0,1}\#/d' \
-e '/[a-z]\#[$?@]{0,1}\#/d' \
-e 's/\s*#.*//g' \
-e 's/^.*\s+//g' \
-e '/^$/d' "${destination}"
Expand Down

0 comments on commit dd3a7a4

Please sign in to comment.