diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2012-12-09 20:02:07 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2012-12-09 20:02:07 +0200 |
commit | 549694bc88a7345c10551d13017fa8a0eccb8619 (patch) | |
tree | 1da27840ad10ac0f1b048f74a240647dee7148da /io.c | |
parent | d20af67ae8a6a573a0db906f9c9960a092f21b41 (diff) | |
download | egawk-549694bc88a7345c10551d13017fa8a0eccb8619.tar.gz egawk-549694bc88a7345c10551d13017fa8a0eccb8619.tar.bz2 egawk-549694bc88a7345c10551d13017fa8a0eccb8619.zip |
Change BINMODE to use symbolic values.
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -233,12 +233,12 @@ binmode(const char *mode) { switch (mode[0]) { case 'r': - if ((BINMODE & 1) != 0) + if ((BINMODE & BINMODE_INPUT) != 0) mode = "rb"; break; case 'w': case 'a': - if ((BINMODE & 2) != 0) + if ((BINMODE & BINMODE_OUTPUT) != 0) mode = (mode[0] == 'w' ? "wb" : "ab"); break; } @@ -1017,7 +1017,7 @@ close_rp(struct redirect *rp, two_way_close_type how) } } else if ((rp->flag & (RED_PIPE|RED_WRITE)) == (RED_PIPE|RED_WRITE)) { /* write to pipe */ status = pclose(rp->fp); - if ((BINMODE & 1) != 0) + if ((BINMODE & BINMODE_INPUT) != 0) os_setbinmode(fileno(stdin), O_BINARY); rp->fp = NULL; @@ -2134,7 +2134,7 @@ gawk_popen(const char *cmd, struct redirect *rp) os_restore_mode(fileno(stdin)); current = popen(cmd, binmode("r")); - if ((BINMODE & 1) != 0) + if ((BINMODE & BINMODE_INPUT) != 0) os_setbinmode(fileno(stdin), O_BINARY); if (current == NULL) return NULL; |