Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion toys/posix/find.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ static int do_find(struct dirtree *new)
test = *arg;
}

} else if (strchr("acm", *s)
} else if (stridx("acm", *s) != -1
&& (!strcmp(s+1, "time") || !strcmp(s+1, "min")))
{
if (check) {
Expand Down
6 changes: 3 additions & 3 deletions toys/posix/printf.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void printf_main(void)

// Parse width.precision between % and type indicator.
*to++ = '%';
while (strchr("-+# '0", *f) && (to-toybuf)<10) *to++ = *f++;
while (stridx("-+# '0", *f) != -1 && (to-toybuf)<10) *to++ = *f++;
for (;;) {
if (chrstart(&f, '*')) {
if (*arg) wp[i] = atolx(*arg++);
Expand All @@ -118,15 +118,15 @@ void printf_main(void)
continue;
} else if (c == 'c') printf(toybuf, wp[0], wp[1], *aa);
else if (c == 's') printf(toybuf, wp[0], wp[1], aa);
else if (strchr("diouxX", c)) {
else if (stridx("diouxX", c) != -1) {
long long ll;

if (*aa == '\'' || *aa == '"') ll = aa[1];
else ll = strtoll(aa, &end, 0);

sprintf(to, "*.*ll%c", c);
printf(toybuf, wp[0], wp[1], ll);
} else if (strchr("feEgG", c)) {
} else if (stridx("feEgG", c) != -1) {
long double ld = strtold(aa, &end);

sprintf(to, "*.*L%c", c);
Expand Down
2 changes: 1 addition & 1 deletion toys/posix/sed.c
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ static char *unescape_delimited_string(char **pstr, char *delim)
if (!mode) {
mode = ']';
if (from[1]=='-' || from[1]==']') *(to++) = *(from++);
} else if (mode == ']' && strchr(".=:", from[1])) {
} else if (mode == ']' && stridx(".=:", from[1]) != -1) {
*(to++) = *(from++);
mode = *from;
}
Expand Down