Fully describe the new dotglob option
Move it to the correct place in the list of options (these things
are sorted!) and flesh out the description of what it (now) does a bit.
While here, fix some minor markup issues in an earlier revision relating
to the new -c option to the read built-in.
sh: fully implement dotglob
Since dotglob has been created, and is now a sh option, implement
it fully, not only for filename completion (but not at all in SMALL
shells).
When dotglob is enabled '*' (etc) matches filenames beginning with
a dot (period, '.') as well as everything else. When it is disabled
the historic practice of only matching files with names starting with
a '.' when the pattern starts (that component) with a '.' continues.
The default (as with most options) is disabled (traditional behaviour).
Note that the names "." and ".." are unaffected by dotglob, they
are only ever matched by a pattern starting with '.'.
Note all of this applies only to filename expansion (aka, glob) and
libedit's filename completion, and not to any other uses of pattern
matching in sh. In all other contexts a '.' is just a character,
wherever it appears, and is matched just the same as anything else.
/bin/sh option list, don't include dotglob in SMALL shells
dotglob is only (currently) used for file completion via libedit.
None of that is included in SMALL shells, so the new dotglob option
is pointless there (just occupies space), just exclude it.
Only match "." and ".." if the filename is non-empty & starts with '.',
regardless of the state of MATCH_HIDDEN_FILES. That's the way bash
actually works, and makes sense.
Also, while here, don't allow calling the completion function to
alter the "match_hidden_files" setting set by EL_MATCH_HIDDEN_FILES
(or not permanently, only for the current match process).
Also, have fn_complete() call fn_complete2() using MATCH_HIDDEN_FILES
if EL_MATCH_HIDDEN_FILES has been set. This gives some purpose to
the global setting, which was otherwise doing nothing at all.
And make the default be to match hidden files (the way libedit used to
work) which seems likely to have been the intent.
kvm_mkdb(8): Replace nonstandard SIZE_T_MAX by standard SIZE_MAX.
Should we delete this? It was unhooked from the build in 2003 and it
no longer builds now:
/home/riastradh/netbsd/current/src/usr.sbin/kvm_mkdb/kvm_mkdb.c: In function 'main':
/home/riastradh/netbsd/current/src/usr.sbin/kvm_mkdb/kvm_mkdb.c:133:24: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
133 | dbname = _PATH_KVMDB;
| ^
/home/riastradh/netbsd/current/src/usr.sbin/kvm_mkdb/kvm_mkdb.c:155:35: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
155 | nlistpath = _PATH_KSYMS;
| ^
/home/riastradh/netbsd/current/src/usr.sbin/kvm_mkdb/kvm_mkdb.c:157:35: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
157 | nlistpath = _PATH_UNIX;
| ^