Trim spaces.

This commit is contained in:
Nicholas Marriott 2011-01-10 22:45:10 +00:00
parent a7b6445cc3
commit abd1f615b2
5 changed files with 25 additions and 25 deletions

View File

@ -1,4 +1,4 @@
/* $Id: forkpty-aix.c,v 1.4 2009-09-20 18:31:16 nicm Exp $ */ /* $Id: forkpty-aix.c,v 1.5 2011-01-10 22:45:09 nicm Exp $ */
/* /*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@ -52,10 +52,10 @@ forkpty(int *master, unused char *name, struct termios *tio, struct winsize *ws)
ioctl(fd, TIOCNOTTY, NULL); ioctl(fd, TIOCNOTTY, NULL);
close(fd); close(fd);
} }
if (setsid() < 0) if (setsid() < 0)
fatal("setsid"); fatal("setsid");
fd = open(_PATH_TTY, O_RDWR|O_NOCTTY); fd = open(_PATH_TTY, O_RDWR|O_NOCTTY);
if (fd >= 0) if (fd >= 0)
fatalx("open succeeded (failed to disconnect)"); fatalx("open succeeded (failed to disconnect)");

View File

@ -1,4 +1,4 @@
/* $Id: forkpty-sunos.c,v 1.9 2009-10-15 07:11:25 nicm Exp $ */ /* $Id: forkpty-sunos.c,v 1.10 2011-01-10 22:45:10 nicm Exp $ */
/* /*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@ -73,7 +73,7 @@ forkpty(int *master, char *name, struct termios *tio, struct winsize *ws)
dup2(slave, 1); dup2(slave, 1);
dup2(slave, 2); dup2(slave, 2);
if (slave > 2) if (slave > 2)
close(slave); close(slave);
return (0); return (0);
} }

View File

@ -1,4 +1,4 @@
/* $Id: strsep.c,v 1.1 2009-08-16 16:15:53 nicm Exp $ */ /* $Id: strsep.c,v 1.2 2011-01-10 22:45:10 nicm Exp $ */
/* $OpenBSD: strsep.c,v 1.6 2005/08/08 08:05:37 espie Exp $ */ /* $OpenBSD: strsep.c,v 1.6 2005/08/08 08:05:37 espie Exp $ */
/*- /*-
@ -35,7 +35,7 @@
/* /*
* Get next token from string *stringp, where tokens are possibly-empty * Get next token from string *stringp, where tokens are possibly-empty
* strings separated by characters from delim. * strings separated by characters from delim.
* *
* Writes NULs into the string at *stringp to end tokens. * Writes NULs into the string at *stringp to end tokens.
* delim need not remain constant from call to call. * delim need not remain constant from call to call.

View File

@ -57,7 +57,7 @@ unvis(char *cp, char c, int *astate, int flag)
if (*astate == S_OCTAL2 || *astate == S_OCTAL3) { if (*astate == S_OCTAL2 || *astate == S_OCTAL3) {
*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);
} }
@ -68,7 +68,7 @@ unvis(char *cp, char c, int *astate, int flag)
if (c == '\\') { if (c == '\\') {
*astate = S_START; *astate = S_START;
return (0); return (0);
} }
*cp = c; *cp = c;
return (UNVIS_VALID); return (UNVIS_VALID);
@ -141,7 +141,7 @@ unvis(char *cp, char c, int *astate, int 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;
@ -152,12 +152,12 @@ unvis(char *cp, char c, int *astate, int 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;
@ -168,15 +168,15 @@ unvis(char *cp, char c, int *astate, int flag)
case S_OCTAL2: /* second possible octal digit */ case S_OCTAL2: /* second possible octal digit */
if (isoctal(c)) { if (isoctal(c)) {
/* /*
* 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);
@ -191,10 +191,10 @@ unvis(char *cp, char c, int *astate, int flag)
* we were done, push back passed char * we were done, push back passed char
*/ */
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);
@ -202,7 +202,7 @@ unvis(char *cp, char c, int *astate, int 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.

View File

@ -136,10 +136,10 @@ done:
/* /*
* strvis, strnvis, strvisx - visually encode characters from src into dst * strvis, strnvis, strvisx - visually encode characters from src into dst
* *
* Dst must be 4 times the size of src to account for possible * Dst must be 4 times the size of src to account for possible
* expansion. The length of dst, not including the trailing NULL, * expansion. The length of dst, not including the trailing NULL,
* is returned. * is returned.
* *
* Strnvis will write no more than siz-1 bytes (and will NULL terminate). * Strnvis will write no more than siz-1 bytes (and will NULL terminate).
* The number of bytes needed to fully encode the string is returned. * The number of bytes needed to fully encode the string is returned.