aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authorAndrew J. Schorr <aschorr@telemetry-investments.com>2016-06-13 18:39:10 -0400
committerAndrew J. Schorr <aschorr@telemetry-investments.com>2016-06-13 18:39:10 -0400
commit18c6b0f85db6683f1d0789e800acfdd35da3ce07 (patch)
tree6f2bd19e71ca42fb2a784451b9486b652fc00090 /io.c
parent0e02913c51b1d737b4d283901e22c57b954e65ae (diff)
downloadegawk-18c6b0f85db6683f1d0789e800acfdd35da3ce07.tar.gz
egawk-18c6b0f85db6683f1d0789e800acfdd35da3ce07.tar.bz2
egawk-18c6b0f85db6683f1d0789e800acfdd35da3ce07.zip
Fix usage of scalar type flag bits and fix some bugs in numeric conversions and lint checks.
Diffstat (limited to 'io.c')
-rw-r--r--io.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/io.c b/io.c
index db903fd7..9d827d75 100644
--- a/io.c
+++ b/io.c
@@ -785,7 +785,7 @@ redirect_string(const char *str, size_t explen, bool not_string,
cant_happen();
}
if (do_lint && not_string)
- lintwarn(_("expression in `%s' redirection only has numeric value"),
+ lintwarn(_("expression in `%s' redirection is a number"),
what);
if (str == NULL || *str == '\0')
@@ -1083,7 +1083,7 @@ redirect_string(const char *str, size_t explen, bool not_string,
struct redirect *
redirect(NODE *redir_exp, int redirtype, int *errflg, bool failure_fatal)
{
- bool not_string = ((redir_exp->flags & STRCUR) == 0);
+ bool not_string = ((redir_exp->flags & STRING) == 0);
redir_exp = force_string(redir_exp);
return redirect_string(redir_exp->stptr, redir_exp->stlen, not_string,
@@ -3896,8 +3896,7 @@ pty_vs_pipe(const char *command)
*/
val = in_PROCINFO(command, "pty", NULL);
if (val) {
- if ((val->flags & MAYBE_NUM) != 0)
- (void) force_number(val);
+ val = fixtype(val);
if ((val->flags & NUMBER) != 0)
return ! iszero(val);
else