Audit strings(1)
Only smaller style-changes. I already refactored the underlying logic a while ago.
This commit is contained in:
parent
3725d501b3
commit
32b9d76747
2
README
2
README
|
@ -69,7 +69,7 @@ The following tools are implemented ('*' == finished, '#' == UTF-8 support,
|
||||||
sort no -m, -o, -d, -f, -i
|
sort no -m, -o, -d, -f, -i
|
||||||
=*| split yes none
|
=*| split yes none
|
||||||
=*| sponge non-posix none
|
=*| sponge non-posix none
|
||||||
#* strings yes none
|
#*| strings yes none
|
||||||
=* sync non-posix none
|
=* sync non-posix none
|
||||||
=* tail yes none
|
=* tail yes none
|
||||||
=* tar non-posix none
|
=* tar non-posix none
|
||||||
|
|
11
strings.c
11
strings.c
|
@ -75,18 +75,19 @@ main(int argc, char *argv[])
|
||||||
usage();
|
usage();
|
||||||
} ARGEND;
|
} ARGEND;
|
||||||
|
|
||||||
if (argc == 0) {
|
if (!argc) {
|
||||||
strings(stdin, "<stdin>", len);
|
strings(stdin, "<stdin>", len);
|
||||||
} else {
|
} else {
|
||||||
for (; argc > 0; argc--, argv++) {
|
for (; *argv; argc--, argv++) {
|
||||||
if (!(fp = fopen(argv[0], "r"))) {
|
if (!(fp = fopen(*argv, "r"))) {
|
||||||
weprintf("fopen %s:", argv[0]);
|
weprintf("fopen %s:", *argv);
|
||||||
ret = 1;
|
ret = 1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
strings(fp, argv[0], len);
|
strings(fp, *argv, len);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user