HomeFreeBSD

indent(1): improve handling of comments and newlines between "if (...)" or

Description

indent(1): improve handling of comments and newlines between "if (...)" or
"while (...)" and "else" or "{"

  • Don't flush newlines - there can be multiple of them and they can happen

before a token that isn't else or {. Instead, always store them in save_com.

  • Don't dump the buffer's contents on newline assuming that there is only

one comment before else or {.

  • Avoid producing surplus newlines, especially before else when -ce is on.
  • When -bl is on, don't treat { as a comment (was implemented by falling

through "case lbrace:" to "case comment:").

This commit fixes the above, but exposes another bug and thus breaks several
other tests. Another commit will make them pass again.

Details

Provenance
pstefAuthored on
Parents
rS334558: Fix a couple of vnode locking cases found during testing with VFS_DEBUG_LOCKS.
Branches
Unknown
Tags
Unknown