diff options
author | Xin LI <delphij@FreeBSD.org> | 2013-01-02 21:53:45 +0000 |
---|---|---|
committer | Xin LI <delphij@FreeBSD.org> | 2013-01-02 21:53:45 +0000 |
commit | c323c12cd8cea3384b83ddef0592138f8eccbe70 (patch) | |
tree | edbe0c815ff6e60da0ddf4265407ce18f44b668f /run.c | |
parent | b0f5e94e3f34717e78a265dc61c6c45406a258d0 (diff) |
Notes
Diffstat (limited to 'run.c')
-rw-r--r-- | run.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1210,13 +1210,13 @@ Cell *dopa2(Node **a, int n) /* a[0], a[1] { a[2] } */ Cell *split(Node **a, int nnn) /* split(a[0], a[1], a[2]); a[3] is type */ { Cell *x = 0, *y, *ap; - char *s; + char *s, *origs; int sep; char *t, temp, num[50], *fs = 0; int n, tempstat, arg3type; y = execute(a[0]); /* source string */ - s = getsval(y); + origs = s = strdup(getsval(y)); arg3type = ptoi(a[3]); if (a[2] == 0) /* fs string */ fs = *FS; @@ -1336,6 +1336,7 @@ Cell *split(Node **a, int nnn) /* split(a[0], a[1], a[2]); a[3] is type */ } tempfree(ap); tempfree(y); + free(origs); if (a[2] != 0 && arg3type == STRING) { tempfree(x); } |