Handle the escaped colon \: in a capability.

PR:		bin/30778
Reviewed by:	ache, peter
MFC after:	3 days
This commit is contained in:
Ruslan Ermilov 2002-08-12 19:13:22 +00:00
parent d837b36904
commit f350abf814
3 changed files with 5 additions and 2 deletions

View File

@ -200,6 +200,7 @@ _nc_read_termcap_entry(const char *const name, TERMTYPE *const tp)
tcs = pd - 1; tcs = pd - 1;
for (;;) { for (;;) {
while ((tok = strsep(&ps, ":")) != NULL && while ((tok = strsep(&ps, ":")) != NULL &&
*(tok - 2) != '\\' &&
(*tok == '\0' || *tok == '\\' || !isgraph(*tok))) (*tok == '\0' || *tok == '\\' || !isgraph(*tok)))
; ;
if (tok == NULL) if (tok == NULL)

View File

@ -200,6 +200,7 @@ _nc_read_termcap_entry(const char *const name, TERMTYPE *const tp)
tcs = pd - 1; tcs = pd - 1;
for (;;) { for (;;) {
while ((tok = strsep(&ps, ":")) != NULL && while ((tok = strsep(&ps, ":")) != NULL &&
*(tok - 2) != '\\' &&
(*tok == '\0' || *tok == '\\' || !isgraph(*tok))) (*tok == '\0' || *tok == '\\' || !isgraph(*tok)))
; ;
if (tok == NULL) if (tok == NULL)

View File

@ -817,8 +817,9 @@ and
.Sy \&\e\e . .Sy \&\e\e .
If it is necessary to place a If it is necessary to place a
.Sy \&: .Sy \&:
in a capability it must be escaped in in a capability it must be escaped as
octal as .Sy \e:
or be encoded as
.Sy \&\e072 . .Sy \&\e072 .
If it is necessary to place a If it is necessary to place a
.Dv NUL .Dv NUL