diff options
| author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2017-04-06 10:54:37 +0000 |
|---|---|---|
| committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2017-04-06 10:54:37 +0000 |
| commit | d91e238ac8d237a232b51603415e456dacc697a6 (patch) | |
| tree | 7d757553249e92091e30b287218ed83ec2309e17 | |
| parent | 59d73dcf2d9b389641c1b420dc1dc2db59257220 (diff) | |
| parent | 50e00a8947ec14a91a17094f3345fc7f980506ae (diff) | |
| download | illumos-joyent-d91e238ac8d237a232b51603415e456dacc697a6.tar.gz | |
[illumos-gate merge]
commit 50e00a8947ec14a91a17094f3345fc7f980506ae
7992 awk_xpg4: misleading-indentation
| -rw-r--r-- | usr/src/cmd/awk_xpg4/awk1.c | 52 |
1 files changed, 22 insertions, 30 deletions
diff --git a/usr/src/cmd/awk_xpg4/awk1.c b/usr/src/cmd/awk_xpg4/awk1.c index c9d5df6478..0d54ebde58 100644 --- a/usr/src/cmd/awk_xpg4/awk1.c +++ b/usr/src/cmd/awk_xpg4/awk1.c @@ -27,8 +27,6 @@ * Copyright 1986, 1994 by Mortice Kern Systems Inc. All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * awk -- mainline, yylex, etc. * @@ -372,17 +370,6 @@ uexit(NODE *np) */ int yylex() -#ifdef DEBUG -{ - int l; - - l = yyhex(); - if (dflag) - (void) printf("%d\n", l); - return (l); -} -yyhex() -#endif { wint_t c, c1; int i; @@ -413,7 +400,8 @@ yyhex() redelim = 0; catterm = 0; savetoken = c; - return (lexlast = lexregexp(c)); + c = lexlast = lexregexp(c); + goto out; } else while ((c = lexgetc()) != WEOF) { if (iswalpha(c) || c == '_') { c = lexid(c); @@ -704,7 +692,7 @@ yyhex() } break; - /* { */ case '}': + case '}': if (nbrace == 0) savetoken = ';'; /*FALLTHRU*/ @@ -727,6 +715,11 @@ yyhex() c = ctosym[i].sym; break; } +out: +#ifdef DEBUG + if (dflag) + (void) printf("%d\n", (int)c); +#endif return ((int)c); } @@ -1093,12 +1086,13 @@ lexgetc() else c = *progptr++; } else { - if (progfp != FNULL) + if (progfp != FNULL) { if (progfp != stdin) (void) fclose(progfp); else clearerr(progfp); progfp = FNULL; + } if (files < progfilep) { filename = *files++; lineno = 1; @@ -1298,8 +1292,7 @@ mbunconvert(wchar_t *str) */ wchar_t * -mbstowcsdup(s) -char *s; +mbstowcsdup(char *s) { int n; wchar_t *w; @@ -1365,8 +1358,7 @@ static const char *const upe_ctrls[] = * string. Otherwise, return an octal escape sequence. */ static const char * -toprint(c) -wchar_t c; +toprint(wchar_t c) { int n, len; unsigned char *ptr; @@ -1566,10 +1558,10 @@ int_regwerror(int errcode, REGEXP r, char *errbuf, size_t bufsiz) int int_regwexec(REGEXP r, /* compiled RE */ - const wchar_t *astring, /* subject string */ - size_t nsub, /* number of subexpressions */ - int_regwmatch_t *sub, /* subexpression pointers */ - int flags) + const wchar_t *astring, /* subject string */ + size_t nsub, /* number of subexpressions */ + int_regwmatch_t *sub, /* subexpression pointers */ + int flags) { char *mbs; regmatch_t *mbsub = NULL; @@ -1614,12 +1606,12 @@ int_regwexec(REGEXP r, /* compiled RE */ } int -int_regwdosuba(REGEXP rp, /* compiled RE: Pattern */ - const wchar_t *rpl, /* replacement string: /rpl/ */ - const wchar_t *src, /* source string */ - wchar_t **dstp, /* destination string */ - int len, /* destination length */ - int *globp) /* IN: occurence, 0 for all; OUT: substitutions */ +int_regwdosuba(REGEXP rp, /* compiled RE: Pattern */ + const wchar_t *rpl, /* replacement string: /rpl/ */ + const wchar_t *src, /* source string */ + wchar_t **dstp, /* destination string */ + int len, /* destination length */ + int *globp) /* IN: occurence, 0 for all; OUT: substitutions */ { wchar_t *dst, *odst; const wchar_t *ip, *xp; |
