freebsd-skq/bin
rse fe548cd4fa Various small code cleanups resulting from a code reviewing
and linting procedure:

1. Remove useless sub-expression:

   - if (*start || (!ifsspc && start > string && (nulonly || 1))) {
   + if (*start || (!ifsspc && start > string)) {

   The sub-expression "(nulonly || 1)" always evaluates to true and
   according to CVS logs seems to be just a left-over from some
   debugging and introduced by accident. Removing the sub-expression
   doesn't change semantics and a code inspection showed that the
   variable "nulonly" is also not necessary here in any way (and the
   expression would require fixing instead of removing).

2. Remove dead code:

   -                if (backslash && c == '\\') {
   -                        if (read(STDIN_FILENO, &c, 1) != 1) {
   -                                status = 1;
   -                                break;
   -                        }
   -                        STPUTC(c, p);
   -                } else if (ap[1] != NULL && strchr(ifs, c) != NULL) {
   +                if (ap[1] != NULL && strchr(ifs, c) != NULL) {

   Inspection of the control and data flow showed that variable
   "backslash" is always false (0) when the "if"-expression is
   evaluated, hence the whole block is effectively dead code.
   Additionally, the skipping of characters after a backslash is already
   performed correctly a few lines above, so this code is also not
   needed at all. According to the CVS logs and the ASH 0.2 sources,
   this code existed in this way already since its early days.

3. Cleanup Style:

   - ! trap[signo][0] == '\0' &&
   + ! (trap[signo][0] == '\0') &&

   The expression wants to ensure the trap is not assigned the empty
   string. But the "!" operator has higher precedence than "==", so the
   comparison should be put into parenthesis to form the intended way of
   expression. Nevertheless the code was effectively not really broken
   as both particular NUL comparisons are semantically equal, of course.
   But the parenthesized version is a lot more intuitive.

4. Remove shadowing variable declaration:

   - char *q;

   The declaration of symbol "q" hides another identical declaration of
   "q" in the same context. As the other "q" is already reused multiple
   times and also can be reused again without negative side-effects,
   just remove the shadowing declaration.

5. Just small cosmetics:

   - if (ifsset() != 0)
   + if (ifsset())

   The ifsset() macro is already coded by returning the boolean result
   of a comparison operator, so no need to compare this boolean result
   again against a numerical value. This also aligns the macros usage to
   the remaining existing code.

Reviewed by: stefanf@
2005-09-06 19:30:00 +00:00
..
cat Add the new standard EXIT STATUS section where appropriate. 2005-01-16 16:41:59 +00:00
chflags Sort sections. 2005-06-14 08:25:54 +00:00
chio Don't specify SRCS= when it can be obtained from PROGS= 2005-01-27 13:25:09 +00:00
chmod Expand contractions. 2005-02-13 23:45:54 +00:00
cp Attempt to complete the userspace integration of POSIX.1e extended ACLs. 2005-09-05 04:36:08 +00:00
csh Don't install examples of NO_EXAMPLES 2005-08-03 09:22:03 +00:00
date Expand *n't contractions. 2005-02-13 22:25:33 +00:00
dd Spell "protections" correctly. 2005-07-28 18:28:11 +00:00
df Add the new standard EXIT STATUS section where appropriate. 2005-01-16 16:41:59 +00:00
domainname /*- or .\"- or #- to begin license clauses. 2005-01-10 08:39:26 +00:00
echo Add the new standard EXIT STATUS section where appropriate. 2005-01-16 16:41:59 +00:00
ed Sync program's usage() with manpage's SYNOPSIS. 2005-02-09 17:37:39 +00:00
expr Add the new standard EXIT STATUS section where appropriate. 2005-01-16 16:41:59 +00:00
getfacl Sync program's usage() with manpage's SYNOPSIS. 2005-02-09 17:37:39 +00:00
hostname There is no /etc/rc.network anymore. 2005-04-17 23:22:22 +00:00
kenv /*- or .\"- or #- to begin license clauses. 2005-01-10 08:39:26 +00:00
kill Add the new standard EXIT STATUS section where appropriate. 2005-01-16 16:41:59 +00:00
ln Expand *n't contractions. 2005-02-13 22:25:33 +00:00
ls Improved descriptions of block size handling. 2005-08-31 17:58:38 +00:00
mkdir Sync program's usage() with manpage's SYNOPSIS. 2005-02-09 17:37:39 +00:00
mv Attempt to complete the userspace integration of POSIX.1e extended ACLs. 2005-09-05 04:36:08 +00:00
pax Fix bin/pax doesn't wait for compress/gzip before exiting. 2005-03-12 06:38:01 +00:00
ps o Typo: s/teminal/terminal/. 2005-04-29 11:10:27 +00:00
pwd Sync program's usage() with manpage's SYNOPSIS. 2005-02-09 17:37:39 +00:00
rcp Expand *n't contractions. 2005-02-13 22:25:33 +00:00
realpath Add the new standard EXIT STATUS section where appropriate. 2005-01-16 16:41:59 +00:00
rm Sync program's usage() with manpage's SYNOPSIS. 2005-02-09 17:37:39 +00:00
rmail Remove kludges intended to support src trees with partial obj trees. 2005-06-10 06:12:53 +00:00
rmdir The new name for the DIAGNOSTICS section is EXIT STATUS. 2005-05-31 12:57:44 +00:00
setfacl Sync program's usage() with manpage's SYNOPSIS. 2005-02-09 17:37:39 +00:00
sh Various small code cleanups resulting from a code reviewing 2005-09-06 19:30:00 +00:00
sleep Fix a comment. 2005-08-07 09:11:38 +00:00
stty Fix: printed output flags (onocr) and (onlret) same as oxtabs 2005-05-26 06:57:57 +00:00
sync /*- or .\"- or #- to begin license clauses. 2005-01-10 08:39:26 +00:00
test /*- or .\"- or #- to begin license clauses. 2005-01-10 08:39:26 +00:00
uuidgen Added the EXIT STATUS section where appropriate. 2005-01-17 07:44:44 +00:00
Makefile Wrap BSD r* commands in NO_RCMDS. 2005-03-02 11:53:22 +00:00
Makefile.inc NOSHARED -> NO_SHARED 2004-12-21 09:59:45 +00:00