aboutsummaryrefslogtreecommitdiffstats
path: root/run.c
diff options
context:
space:
mode:
Diffstat (limited to 'run.c')
-rw-r--r--run.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/run.c b/run.c
index ce30e93..2dfb3e6 100644
--- a/run.c
+++ b/run.c
@@ -425,6 +425,10 @@ Cell *awkgetline(Node **a, int n) /* get next line from specific input */
} else if (a[0] != NULL) { /* getline var <file */
x = execute(a[0]);
setsval(x, buf);
+ if (is_number(x->sval)) {
+ x->fval = atof(x->sval);
+ x->tval |= NUM;
+ }
tempfree(x);
} else { /* getline <file */
setsval(fldtab[0], buf);
@@ -440,6 +444,10 @@ Cell *awkgetline(Node **a, int n) /* get next line from specific input */
n = getrec(&buf, &bufsize, 0);
x = execute(a[0]);
setsval(x, buf);
+ if (is_number(x->sval)) {
+ x->fval = atof(x->sval);
+ x->tval |= NUM;
+ }
tempfree(x);
}
}