Refactor cut.1 and cut.c

and reflect recent changes to the role of "delim".
This commit is contained in:
FRIGN 2015-01-24 22:53:37 +01:00
parent eb57becb38
commit c369844ae2
2 changed files with 7 additions and 4 deletions

4
cut.1
View File

@ -53,9 +53,9 @@ delimiters are passed through, unless
.Fl s
is specified.
.It Fl d Ar delim
Use first byte of
Use
.Ar delim
as field delimiter. Default is \et.
as field delimiter, which can be an arbitrary string. Default is '\et'.
.It Fl s
Suppress lines not containing field delimiters.
.El

7
cut.c
View File

@ -158,8 +158,11 @@ resolveescapes(char *s, size_t len)
case 'r': s[i] = '\r'; off++; break;
case 't': s[i] = '\t'; off++; break;
case 'v': s[i] = '\v'; off++; break;
case '\0': eprintf("cut: null escape sequence in delimiter\n");
default: eprintf("cut: invalid escape sequence '\\%c' in delimiter\n", s[i + 1]);
case '\0':
eprintf("cut: null escape sequence in delimiter\n");
default:
eprintf("cut: invalid escape sequence '\\%c' in"
"delimiter\n", s[i + 1]);
}
for (m = i + 1; m <= len - off; m++)