version 1.42, 2017/10/09 14:51:31 |
version 1.43, 2019/08/13 10:41:33 |
|
|
Cell *split(Node **a, int nnn) /* split(a[0], a[1], a[2]); a[3] is type */ |
Cell *split(Node **a, int nnn) /* split(a[0], a[1], a[2]); a[3] is type */ |
{ |
{ |
Cell *x = 0, *y, *ap; |
Cell *x = 0, *y, *ap; |
char *s; |
char *s, *origs; |
int sep; |
int sep; |
char *t, temp, num[50], *fs = 0; |
char *t, temp, num[50], *fs = 0; |
int n, tempstat, arg3type; |
int n, tempstat, arg3type; |
|
|
y = execute(a[0]); /* source string */ |
y = execute(a[0]); /* source string */ |
s = getsval(y); |
origs = s = strdup(getsval(y)); |
arg3type = ptoi(a[3]); |
arg3type = ptoi(a[3]); |
if (a[2] == 0) /* fs string */ |
if (a[2] == 0) /* fs string */ |
fs = *FS; |
fs = *FS; |
|
|
} |
} |
tempfree(ap); |
tempfree(ap); |
tempfree(y); |
tempfree(y); |
|
free(origs); |
if (a[2] != 0 && arg3type == STRING) { |
if (a[2] != 0 && arg3type == STRING) { |
tempfree(x); |
tempfree(x); |
} |
} |