mostly more KNF

This commit is contained in:
mirabilos 2017-03-26 00:18:21 +01:00
parent 859746b30b
commit e216226f68
4 changed files with 8 additions and 12 deletions

2
edit.c
View File

@ -146,7 +146,7 @@ static int
x_getc(void) x_getc(void)
{ {
#ifdef __OS2__ #ifdef __OS2__
return _read_kbd(0, 1, 0); return (_read_kbd(0, 1, 0));
#else #else
char c; char c;
ssize_t n; ssize_t n;

5
eval.c
View File

@ -883,9 +883,8 @@ expand(
#ifdef __OS2__ #ifdef __OS2__
c == '\r' || c == '\r' ||
#endif #endif
c == '\n') c == '\n') {
#ifdef __OS2__ #ifdef __OS2__
{
if (c == '\r') { if (c == '\r') {
c = shf_getc(x.u.shf); c = shf_getc(x.u.shf);
switch (c) { switch (c) {
@ -903,9 +902,7 @@ expand(
if (c == '\n') if (c == '\n')
/* save newlines */ /* save newlines */
newlines++; newlines++;
#ifdef __OS2__
} }
#endif
if (newlines && c != -1) { if (newlines && c != -1) {
shf_ungetc(c, x.u.shf); shf_ungetc(c, x.u.shf);
c = '\n'; c = '\n';

2
exec.c
View File

@ -984,7 +984,7 @@ scriptexec(struct op *tp, const char **ap)
/* execute .cmd and .bat with OS2_SHELL, usually CMD.EXE */ /* execute .cmd and .bat with OS2_SHELL, usually CMD.EXE */
sh = getenv("OS2_SHELL"); sh = getenv("OS2_SHELL");
*tp->args-- = "/c"; *tp->args-- = "/c";
/* convert slahes to back-slashes */ /* convert slahes to backslashes */
for (cp = tp->str; *cp; cp++) { for (cp = tp->str; *cp; cp++) {
if (*cp == '/') if (*cp == '/')
*cp = '\\'; *cp = '\\';

3
sh.h
View File

@ -2444,8 +2444,7 @@ extern int tty_init_fd(void); /* initialise tty_fd, tty_devtty */
((char *)((ksh_isalphx(mksh_sdirsep_s[0]) && \ ((char *)((ksh_isalphx(mksh_sdirsep_s[0]) && \
mksh_sdirsep_s[1] == ':' && \ mksh_sdirsep_s[1] == ':' && \
!mksh_cdirsep(mksh_sdirsep_s[2])) ? \ !mksh_cdirsep(mksh_sdirsep_s[2])) ? \
(mksh_sdirsep_s + 1) : \ (mksh_sdirsep_s + 1) : strpbrk(mksh_sdirsep_s, "/\\"))); \
strpbrk(mksh_sdirsep_s, "/\\"))); \
}) })
#define mksh_vdirsep(s) (mksh_sdirsep((s)) != NULL) #define mksh_vdirsep(s) (mksh_sdirsep((s)) != NULL)
#else #else