Fix style bugs I found, and add a comment.
This commit is contained in:
parent
6fba85a0cf
commit
bd90b9c76e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=86622
@ -204,18 +204,19 @@ main(argc, argv)
|
||||
else
|
||||
p++;
|
||||
if (strcmp(p, "[") == 0) {
|
||||
if (strcmp(argv[--argc], "]"))
|
||||
if (strcmp(argv[--argc], "]") != 0)
|
||||
error("missing ]");
|
||||
argv[argc] = NULL;
|
||||
}
|
||||
|
||||
/* no expression => false */
|
||||
if (--argc <= 0)
|
||||
return 1;
|
||||
|
||||
/* XXX work around the absence of an eaccess(2) syscall */
|
||||
(void)setgid(getegid());
|
||||
(void)setuid(geteuid());
|
||||
|
||||
if (--argc <= 0)
|
||||
return 1;
|
||||
|
||||
t_wp = &argv[1];
|
||||
res = !oexpr(t_lex(*t_wp));
|
||||
|
||||
@ -469,13 +470,13 @@ getn(s)
|
||||
r = strtol(s, &p, 10);
|
||||
|
||||
if (errno != 0)
|
||||
error("%s: out of range", s);
|
||||
error("%s: out of range", s);
|
||||
|
||||
while (isspace((unsigned char)*p))
|
||||
p++;
|
||||
p++;
|
||||
|
||||
if (*p)
|
||||
error("%s: bad number", s);
|
||||
error("%s: bad number", s);
|
||||
|
||||
return (int) r;
|
||||
}
|
||||
@ -492,13 +493,13 @@ getq(s)
|
||||
r = strtoq(s, &p, 10);
|
||||
|
||||
if (errno != 0)
|
||||
error("%s: out of range", s);
|
||||
error("%s: out of range", s);
|
||||
|
||||
while (isspace((unsigned char)*p))
|
||||
p++;
|
||||
p++;
|
||||
|
||||
if (*p)
|
||||
error("%s: bad number", s);
|
||||
error("%s: bad number", s);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user