Respect exit status in strings(1) and update manpage
This commit is contained in:
parent
d0604cc474
commit
aabcb69991
19
strings.1
19
strings.1
|
@ -1,10 +1,13 @@
|
||||||
.TH STRINGS 1 sbase\-VERSION
|
.Dd November 23, 2014
|
||||||
.SH NAME
|
.Dt STRINGS 1 sbase\-VERSION
|
||||||
strings \- print the strings of printable characters in files
|
.Os
|
||||||
.SH SYNOPSIS
|
.Sh NAME
|
||||||
.B strings
|
.Nm strings
|
||||||
.IR file...
|
.Nd print the strings of pritable characters in files
|
||||||
.SH DESCRIPTION
|
.Sh SYNOPSIS
|
||||||
.B strings
|
.Nm strings
|
||||||
|
.Op Ar file ...
|
||||||
|
.Sh DESCRIPTION
|
||||||
|
.Nm
|
||||||
prints the printable character sequences that are at least 6 characters
|
prints the printable character sequences that are at least 6 characters
|
||||||
long. If no files are given then it uses stdin.
|
long. If no files are given then it uses stdin.
|
||||||
|
|
|
@ -10,13 +10,14 @@ static void dostrings(FILE *fp, const char *fname);
|
||||||
static void
|
static void
|
||||||
usage(void)
|
usage(void)
|
||||||
{
|
{
|
||||||
eprintf("usage: %s file...\n", argv0);
|
eprintf("usage: %s [file ...]\n", argv0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
ARGBEGIN {
|
ARGBEGIN {
|
||||||
default:
|
default:
|
||||||
|
@ -29,14 +30,14 @@ main(int argc, char *argv[])
|
||||||
for (; argc > 0; argc--, argv++) {
|
for (; argc > 0; argc--, argv++) {
|
||||||
if (!(fp = fopen(argv[0], "r"))) {
|
if (!(fp = fopen(argv[0], "r"))) {
|
||||||
weprintf("fopen %s:", argv[0]);
|
weprintf("fopen %s:", argv[0]);
|
||||||
|
ret = 1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
dostrings(fp, argv[0]);
|
dostrings(fp, argv[0]);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return ret;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue
Block a user