code-style: minor cleanup and nitpicking

This commit is contained in:
Hiltjo Posthuma 2015-02-20 13:28:24 +01:00
parent 6c7ff5fda5
commit 31f0624f3d
8 changed files with 20 additions and 20 deletions

10
sed.c
View File

@ -820,6 +820,7 @@ char *
get_s_arg(Cmd *c, char *s) get_s_arg(Cmd *c, char *s)
{ {
Rune delim, r; Rune delim, r;
Cmd buf;
char *p; char *p;
int esc; int esc;
@ -901,13 +902,13 @@ get_s_arg(Cmd *c, char *s)
for (; s < p; s++) { for (; s < p; s++) {
if (isdigit(*s)) { if (isdigit(*s)) {
c->u.s.occurrence = stol(s, &s); c->u.s.occurrence = stol(s, &s);
} else switch (*s) { } else {
case 'p' : c->u.s.p = 1; break; switch (*s) {
case 'g': c->u.s.occurrence = 0; break; case 'g': c->u.s.occurrence = 0; break;
case 'w' : { case 'p': c->u.s.p = 1; break;
case 'w':
/* must be last flag, take everything up to newline/semicolon /* must be last flag, take everything up to newline/semicolon
* s == p after this */ * s == p after this */
Cmd buf;
s = get_w_arg(&buf, s); s = get_w_arg(&buf, s);
c->u.s.file = buf.u.file; c->u.s.file = buf.u.file;
break; break;
@ -927,7 +928,6 @@ free_s_arg(Cmd *c)
free(c->u.s.repl.str); free(c->u.s.repl.str);
} }
/* see get_r_arg notes */ /* see get_r_arg notes */
char * char *
get_w_arg(Cmd *c, char *s) get_w_arg(Cmd *c, char *s)