mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-07 05:06:36 +02:00
Fixed up command-line-args
This commit is contained in:
parent
6489cb3c7f
commit
1cc957a6d8
1 changed files with 6 additions and 9 deletions
15
runtime.c
15
runtime.c
|
@ -896,19 +896,16 @@ string_type Cyc_substring(object str, object start, object end) {
|
||||||
object Cyc_command_line_arguments(object cont) {
|
object Cyc_command_line_arguments(object cont) {
|
||||||
int i;
|
int i;
|
||||||
object lis = nil;
|
object lis = nil;
|
||||||
for (i = argc; i > 0; i--) {
|
for (i = _cyc_argc; i > 0; i--) {
|
||||||
object ps = alloca(sizeof(string_type));
|
object ps = alloca(sizeof(string_type));
|
||||||
object pl = alloca(sizeof(cons_type));
|
object pl = alloca(sizeof(cons_type));
|
||||||
make_string(s, _cyc_argv[i - 1]);
|
make_string(s, _cyc_argv[i - 1]);
|
||||||
memcpy(ps, s, sizeof(string_type));
|
memcpy(ps, &s, sizeof(string_type));
|
||||||
|
((list)pl)->tag = cons_tag;
|
||||||
TODO: unfortunately this won't work because vars will get clobbered. need to use alloca
|
((list)pl)->cons_car = ps;
|
||||||
to get fresh memory each iteration for s and l.
|
((list)pl)->cons_cdr = lis;
|
||||||
attempting to above, but code is incomplete
|
lis = pl;
|
||||||
// make_cons(l, &s, lis);
|
|
||||||
// lis = &l;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return_funcall1(cont, lis);
|
return_funcall1(cont, lis);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue