Please turn it on in your browser preferences.
for specific sites, we recommend the
Review Request #191
Created May 12, 2016 and submitted June 1, 2016, 9:52 a.m.
Don't forget to update the usage message to describe -s.
No need for this te thing with madoc.
What happens if c_hostname does not contain any periods? Won't strcspn return 0 and therefore we end up printing an empty string? Should this print the whole string if there is no "domain" info?
No, if there are no periods this will print the entire string. Using strcspn like this is a somewhat common idiom (it returns the length of the string, ie. the index of the null terminator, if it doesn't encounter any characters from s2)
Sorry, I mixed up strcspn and strspn.
Revision 2 (+35 -24)
Does it make sense to ignore '-s' when setting the hostname?
The other alternative is to give an error. I don't really have a strong opinion, but OpenBSD's hostname(1) works like this as well - '-s' becomes a no-op if you give an argument.
We should probably do it the same way even though that seems wrong to me.
Fix pbchk nits.
Revision 3 (+36 -26)