diff options
author | Jim Meyering <jim@meyering.net> | 2008-01-16 14:05:55 +0100 |
---|---|---|
committer | Paolo Bonzini <bonzini@gnu.org> | 2008-01-16 14:52:48 +0100 |
commit | fb871b6b563c85c8502dc5592e38ab03a0964465 (patch) | |
tree | 457960efaa53fcd8d1a9b79bc701763a6f4b55d9 /sed | |
parent | dbd7863bc7ed97b2f2cbf1f52948ad9e3eee03bf (diff) | |
download | sed-fb871b6b563c85c8502dc5592e38ab03a0964465.tar.gz |
sed/execute.c: Avoid warnings from gcc, avoid shadowing global "pipe".
2008-01-16 Jim Meyering <meyering@redhat.com>
* sed/execute.c (open_next_file, get_backup_file_name): Avoid
warnings from gcc. Avoid shadowing global "pipe".
Diffstat (limited to 'sed')
-rw-r--r-- | sed/execute.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/sed/execute.c b/sed/execute.c index 490d3b7..050198a 100644 --- a/sed/execute.c +++ b/sed/execute.c @@ -1236,23 +1236,23 @@ do_subst(sub) if (sub->eval) { #ifdef HAVE_POPEN - FILE *pipe; + FILE *pipe_fp; line_reset(&s_accum, NULL); str_append (&line, "", 1); - pipe = popen(line.active, "r"); + pipe_fp = popen(line.active, "r"); - if (pipe != NULL) + if (pipe_fp != NULL) { - while (!feof (pipe)) + while (!feof (pipe_fp)) { char buf[4096]; - int n = fread (buf, sizeof(char), 4096, pipe); + int n = fread (buf, sizeof(char), 4096, pipe_fp); if (n > 0) str_append(&s_accum, buf, n); } - pclose (pipe); + pclose (pipe_fp); /* Exchange line and s_accum. This can be much cheaper than copying s_accum.active into line.text (for huge lines). See comment above @@ -1395,28 +1395,28 @@ execute_program(vec, input) case 'e': { #ifdef HAVE_POPEN - FILE *pipe; + FILE *pipe_fp; int cmd_length = cur_cmd->x.cmd_txt.text_length; line_reset(&s_accum, NULL); if (!cmd_length) { str_append (&line, "", 1); - pipe = popen(line.active, "r"); + pipe_fp = popen(line.active, "r"); } else { cur_cmd->x.cmd_txt.text[cmd_length - 1] = 0; - pipe = popen(cur_cmd->x.cmd_txt.text, "r"); + pipe_fp = popen(cur_cmd->x.cmd_txt.text, "r"); output_missing_newline(&output_file); } - if (pipe != NULL) + if (pipe_fp != NULL) { char buf[4096]; int n; - while (!feof (pipe)) - if ((n = fread (buf, sizeof(char), 4096, pipe)) > 0) + while (!feof (pipe_fp)) + if ((n = fread (buf, sizeof(char), 4096, pipe_fp)) > 0) { if (!cmd_length) str_append(&s_accum, buf, n); @@ -1424,7 +1424,7 @@ execute_program(vec, input) ck_fwrite(buf, 1, n, output_file.fp); } - pclose (pipe); + pclose (pipe_fp); if (!cmd_length) { /* Store into pattern space for plain `e' commands */ |