Compare commits
2 commits
565d567523
...
704d400029
Author | SHA1 | Date | |
---|---|---|---|
|
704d400029 | ||
|
25420eea5d |
2 changed files with 6 additions and 2 deletions
|
@ -53,6 +53,7 @@
|
|||
- new "-p" option to run non-Unu format source files
|
||||
- now report "<none>" for `script:name` if no file is being
|
||||
run
|
||||
- now report 0 for `script:arguments` if not running a program
|
||||
|
||||
Future Notes
|
||||
|
||||
|
|
|
@ -551,7 +551,10 @@ V scripting_arg(NgaState *vm) {
|
|||
}
|
||||
|
||||
V scripting_arg_count(NgaState *vm) {
|
||||
stack_push(vm, vm->sys_argc - 2);
|
||||
if ((vm->sys_argc - 2) <= 0)
|
||||
stack_push(vm, 0);
|
||||
else
|
||||
stack_push(vm, vm->sys_argc - 2);
|
||||
}
|
||||
|
||||
V scripting_include(NgaState *vm) {
|
||||
|
@ -563,7 +566,7 @@ V scripting_include_plain(NgaState *vm) {
|
|||
}
|
||||
|
||||
V scripting_name(NgaState *vm) {
|
||||
if ((vm->sys_argc - 2) <= 0)
|
||||
if (vm->sys_argc == 1)
|
||||
stack_push(vm, string_inject(vm, "<none>", stack_pop(vm)));
|
||||
else
|
||||
stack_push(vm, string_inject(vm, vm->sys_argv[1], stack_pop(vm)));
|
||||
|
|
Loading…
Reference in a new issue