[hackers] [sbase] Refactor cut.1 and cut.c || FRIGN
commit 92b133c03fc6075c4e1c55487f19bc1514d23079
Author: FRIGN <dev_AT_frign.de>
Date: Sat Jan 24 22:53:37 2015 +0100
Refactor cut.1 and cut.c
and reflect recent changes to the role of "delim".
diff --git a/cut.1 b/cut.1
index bd242a0..0ef177d 100644
--- a/cut.1
+++ b/cut.1
_AT_@ -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
diff --git a/cut.c b/cut.c
index cd43703..a477f3f 100644
--- a/cut.c
+++ b/cut.c
_AT_@ -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++)
Received on Sat Jan 24 2015 - 23:44:59 CET
This archive was generated by hypermail 2.3.0
: Sat Jan 24 2015 - 23:48:13 CET