Skip to content

Conversation

@drwetter
Copy link
Collaborator

@drwetter drwetter commented Nov 3, 2025

grep -w matches also string1-whatsoever so that entries like

192.168.0.10 anystring anystring-apache
192.168.0.11 anystring-tomcat

matched 3 entries over 2 lines.

This PR fixes #2937 by improving the pattern, so that string1 needs a trailing whitespace or a EOL -- besides a leaing whitespace..

What is your pull request about?

  • Bug fix
  • Improvement
  • New feature (adds functionality)
  • Breaking change (bug fix, feature or improvement that would cause existing functionality to not work as expected)
  • Typo fix
  • Documentation update
  • Update of other files

If it's a code change please check the boxes which are applicable

  • For the main program: My edits contain no tabs, indentation is five spaces and any line endings do not contain any blank chars
  • I've read CONTRIBUTING.md and Coding_Convention.md
  • I have tested this fix or improvement against >=2 hosts and I couldn't spot a problem
  • I have tested this new feature against >=2 hosts which show this feature and >=2 host which does not (in order to avoid side effects) . I couldn't spot a problem
  • For the new feature I have made corresponding changes to the documentation and / or to help()
  • If it's a bigger change: I added myself to CREDITS.md (alphabetical order) and the change to CHANGELOG.md

`grep -w` matches also `string1-whatsoever` so that entries like

```
192.168.0.10 anystring anystring-apache
192.168.0.11 anystring-tomcat
```

matched 3 entries over 2 lines.

This PR fixes #2937 by improving the match pattern, so that
`string1` needs a trailing whitespace or a EOL -- besides a
leaing whitespace.
@drwetter drwetter merged commit f219fd6 into 3.3dev Nov 3, 2025
4 checks passed
@drwetter drwetter deleted the fix_2937 branch November 3, 2025 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG / possible BUG] /etc/hosts with multiple hostnames in one line

2 participants