De-lispify some if()-expressions by removing extra parantheses.
Patch: 7.160 Requested by: harti Submitted by: Max Okumoto <okumoto@ucsd.edu>
This commit is contained in:
parent
b6c44471ba
commit
29b59e2865
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=143967
@ -869,11 +869,11 @@ modifier_M(VarParser *vp, const char value[], char endc)
|
||||
patt = estrdup(vp->ptr);
|
||||
ptr = patt;
|
||||
while (vp->ptr[0] != '\0') {
|
||||
if ((vp->ptr[0] == endc) || (vp->ptr[0] == ':')) {
|
||||
if (vp->ptr[0] == endc || vp->ptr[0] == ':') {
|
||||
break;
|
||||
}
|
||||
if ((vp->ptr[0] == '\\') &&
|
||||
((vp->ptr[1] == endc) || (vp->ptr[1] == ':'))) {
|
||||
if (vp->ptr[0] == '\\' &&
|
||||
(vp->ptr[1] == endc || vp->ptr[1] == ':')) {
|
||||
vp->ptr++; /* consume backslash */
|
||||
}
|
||||
*ptr = vp->ptr[0];
|
||||
@ -1307,8 +1307,8 @@ ParseRestModifier(VarParser *vp, char startc, Buffer *buf, Boolean *freeResult)
|
||||
* specially as they are the only four that will be set when
|
||||
* dynamic sources are expanded.
|
||||
*/
|
||||
if ((vlen == 1) ||
|
||||
((vlen == 2) && (vname[1] == 'F' || vname[1] == 'D'))) {
|
||||
if (vlen == 1 ||
|
||||
(vlen == 2 && (vname[1] == 'F' || vname[1] == 'D'))) {
|
||||
if (strchr("!%*@", vname[0]) != NULL) {
|
||||
value = emalloc(consumed + 1);
|
||||
strncpy(value, vp->input, consumed);
|
||||
@ -1318,8 +1318,8 @@ ParseRestModifier(VarParser *vp, char startc, Buffer *buf, Boolean *freeResult)
|
||||
return (value);
|
||||
}
|
||||
}
|
||||
if ((vlen > 2) &&
|
||||
(vname[0] == '.') &&
|
||||
if (vlen > 2 &&
|
||||
vname[0] == '.' &&
|
||||
isupper((unsigned char)vname[1])) {
|
||||
if ((strncmp(vname, ".TARGET", vlen - 1) == 0) ||
|
||||
(strncmp(vname, ".ARCHIVE", vlen - 1) == 0) ||
|
||||
@ -1338,7 +1338,7 @@ ParseRestModifier(VarParser *vp, char startc, Buffer *buf, Boolean *freeResult)
|
||||
* Check for D and F forms of local variables since we're in
|
||||
* a local context and the name is the right length.
|
||||
*/
|
||||
if ((vlen == 2) &&
|
||||
if (vlen == 2 &&
|
||||
(vname[1] == 'F' || vname[1] == 'D') &&
|
||||
(strchr("!%*<>@", vname[0]) != NULL)) {
|
||||
char name[2];
|
||||
@ -1393,7 +1393,7 @@ ParseRestEnd(VarParser *vp, Buffer *buf, Boolean *freeResult)
|
||||
}
|
||||
|
||||
if ((vp->ctxt == VAR_CMD) || (vp->ctxt == VAR_GLOBAL)) {
|
||||
size_t consumed = vp->ptr - vp->input + 1;
|
||||
size_t consumed = vp->ptr - vp->input + 1;
|
||||
|
||||
/*
|
||||
* If substituting a local variable in a non-local context,
|
||||
@ -1404,8 +1404,8 @@ ParseRestEnd(VarParser *vp, Buffer *buf, Boolean *freeResult)
|
||||
* specially as they are the only four that will be set when
|
||||
* dynamic sources are expanded.
|
||||
*/
|
||||
if (((vlen == 1)) ||
|
||||
((vlen == 2) && (vname[1] == 'F' || vname[1] == 'D'))) {
|
||||
if (vlen == 1 ||
|
||||
(vlen == 2 && (vname[1] == 'F' || vname[1] == 'D'))) {
|
||||
if (strchr("!%*@", vname[0]) != NULL) {
|
||||
value = emalloc(consumed + 1);
|
||||
strncpy(value, vp->input, consumed);
|
||||
@ -1415,8 +1415,8 @@ ParseRestEnd(VarParser *vp, Buffer *buf, Boolean *freeResult)
|
||||
return (value);
|
||||
}
|
||||
}
|
||||
if ((vlen > 2) &&
|
||||
(vname[0] == '.') &&
|
||||
if (vlen > 2 &&
|
||||
vname[0] == '.' &&
|
||||
isupper((unsigned char)vname[1])) {
|
||||
if ((strncmp(vname, ".TARGET", vlen - 1) == 0) ||
|
||||
(strncmp(vname, ".ARCHIVE", vlen - 1) == 0) ||
|
||||
@ -1435,7 +1435,7 @@ ParseRestEnd(VarParser *vp, Buffer *buf, Boolean *freeResult)
|
||||
* Check for D and F forms of local variables since we're in
|
||||
* a local context and the name is the right length.
|
||||
*/
|
||||
if ((vlen == 2) &&
|
||||
if (vlen == 2 &&
|
||||
(vname[1] == 'F' || vname[1] == 'D') &&
|
||||
(strchr("!%*<>@", vname[0]) != NULL)) {
|
||||
char name[2];
|
||||
|
Loading…
Reference in New Issue
Block a user