More whitespace consistency tweaks
This commit is contained in:
parent
248b38c348
commit
a1273fe760
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: unvis.c,v 1.26 2005/05/16 11:40:16 lukem Exp $ */
|
/* $NetBSD: unvis.c,v 1.27 2005/05/16 11:42:04 lukem Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1989, 1993
|
* Copyright (c) 1989, 1993
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
#if 0
|
#if 0
|
||||||
static char sccsid[] = "@(#)unvis.c 8.1 (Berkeley) 6/4/93";
|
static char sccsid[] = "@(#)unvis.c 8.1 (Berkeley) 6/4/93";
|
||||||
#else
|
#else
|
||||||
__RCSID("$NetBSD: unvis.c,v 1.26 2005/05/16 11:40:16 lukem Exp $");
|
__RCSID("$NetBSD: unvis.c,v 1.27 2005/05/16 11:42:04 lukem Exp $");
|
||||||
#endif
|
#endif
|
||||||
#endif /* LIBC_SCCS and not lint */
|
#endif /* LIBC_SCCS and not lint */
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ __unvis13(cp, c, astate, flag)
|
||||||
|| *astate == S_HEX2) {
|
|| *astate == S_HEX2) {
|
||||||
*astate = S_GROUND;
|
*astate = S_GROUND;
|
||||||
return (UNVIS_VALID);
|
return (UNVIS_VALID);
|
||||||
}
|
}
|
||||||
return (*astate == S_GROUND ? UNVIS_NOCHAR : UNVIS_SYNBAD);
|
return (*astate == S_GROUND ? UNVIS_NOCHAR : UNVIS_SYNBAD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ __unvis13(cp, c, astate, flag)
|
||||||
if (c == '\\') {
|
if (c == '\\') {
|
||||||
*astate = S_START;
|
*astate = S_START;
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
if ((flag & VIS_HTTPSTYLE) && c == '%') {
|
if ((flag & VIS_HTTPSTYLE) && c == '%') {
|
||||||
*astate = S_HEX1;
|
*astate = S_HEX1;
|
||||||
return (0);
|
return (0);
|
||||||
|
@ -191,7 +191,7 @@ __unvis13(cp, c, astate, flag)
|
||||||
}
|
}
|
||||||
*astate = S_GROUND;
|
*astate = S_GROUND;
|
||||||
return (UNVIS_SYNBAD);
|
return (UNVIS_SYNBAD);
|
||||||
|
|
||||||
case S_META:
|
case S_META:
|
||||||
if (c == '-')
|
if (c == '-')
|
||||||
*astate = S_META1;
|
*astate = S_META1;
|
||||||
|
@ -202,12 +202,12 @@ __unvis13(cp, c, astate, flag)
|
||||||
return (UNVIS_SYNBAD);
|
return (UNVIS_SYNBAD);
|
||||||
}
|
}
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
case S_META1:
|
case S_META1:
|
||||||
*astate = S_GROUND;
|
*astate = S_GROUND;
|
||||||
*cp |= c;
|
*cp |= c;
|
||||||
return (UNVIS_VALID);
|
return (UNVIS_VALID);
|
||||||
|
|
||||||
case S_CTRL:
|
case S_CTRL:
|
||||||
if (c == '?')
|
if (c == '?')
|
||||||
*cp |= 0177;
|
*cp |= 0177;
|
||||||
|
@ -218,15 +218,15 @@ __unvis13(cp, c, astate, flag)
|
||||||
|
|
||||||
case S_OCTAL2: /* second possible octal digit */
|
case S_OCTAL2: /* second possible octal digit */
|
||||||
if (isoctal(uc)) {
|
if (isoctal(uc)) {
|
||||||
/*
|
/*
|
||||||
* yes - and maybe a third
|
* yes - and maybe a third
|
||||||
*/
|
*/
|
||||||
*cp = (*cp << 3) + (c - '0');
|
*cp = (*cp << 3) + (c - '0');
|
||||||
*astate = S_OCTAL3;
|
*astate = S_OCTAL3;
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* no - done with current sequence, push back passed char
|
* no - done with current sequence, push back passed char
|
||||||
*/
|
*/
|
||||||
*astate = S_GROUND;
|
*astate = S_GROUND;
|
||||||
return (UNVIS_VALIDPUSH);
|
return (UNVIS_VALIDPUSH);
|
||||||
|
@ -248,23 +248,23 @@ __unvis13(cp, c, astate, flag)
|
||||||
*astate = S_HEX2;
|
*astate = S_HEX2;
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* no - done with current sequence, push back passed char
|
* no - done with current sequence, push back passed char
|
||||||
*/
|
*/
|
||||||
*astate = S_GROUND;
|
*astate = S_GROUND;
|
||||||
return (UNVIS_VALIDPUSH);
|
return (UNVIS_VALIDPUSH);
|
||||||
|
|
||||||
case S_HEX2:
|
case S_HEX2:
|
||||||
*astate = S_GROUND;
|
*astate = S_GROUND;
|
||||||
if (isxdigit(uc)) {
|
if (isxdigit(uc)) {
|
||||||
*cp = xtod(uc) | (*cp << 4);
|
*cp = xtod(uc) | (*cp << 4);
|
||||||
return (UNVIS_VALID);
|
return (UNVIS_VALID);
|
||||||
}
|
}
|
||||||
return (UNVIS_VALIDPUSH);
|
return (UNVIS_VALIDPUSH);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
/*
|
/*
|
||||||
* decoder in unknown state - (probably uninitialized)
|
* decoder in unknown state - (probably uninitialized)
|
||||||
*/
|
*/
|
||||||
*astate = S_GROUND;
|
*astate = S_GROUND;
|
||||||
return (UNVIS_SYNBAD);
|
return (UNVIS_SYNBAD);
|
||||||
|
@ -272,7 +272,7 @@ __unvis13(cp, c, astate, flag)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* strunvis - decode src into dst
|
* strunvis - decode src into dst
|
||||||
*
|
*
|
||||||
* Number of chars decoded into dst is returned, -1 on error.
|
* Number of chars decoded into dst is returned, -1 on error.
|
||||||
* Dst is null terminated.
|
* Dst is null terminated.
|
||||||
|
|
Loading…
Reference in New Issue