check that -o output is a list

This commit is contained in:
dzaima 2023-12-13 17:49:46 +02:00
parent 0cd1ea9bdc
commit 7bf379a44e

View File

@ -981,6 +981,7 @@ int main(int argc, char* argv[]) {
}
case 'o': { repl_init(); REQARG(o);
B r = gsc_exec_inplace(utf8Decode0(argv[i++]), "(-o)", emptySVec());
if (isAtm(r) || RNK(r)!=1) thrM("(-o): Value to print must be a string");
printsB(r); dec(r);
printf("\n");
break;