Closed oflebbe closed 4 years ago
I also have encountered the same problem. Checking the crash logs, a EXC_BREAKPOINT (SIGTRAP) exception causes the crash. It could be that @ColdGrub1384 accidentally left some sort of breakpoint (for debugging). The crash log file is attached. LibTerm-2020-04-26-142657.txt
I did more research on this SIGTRAP, and it could be because of this line here, in the main() function for jsc
:
https://github.com/ColdGrub1384/LibTerm/blob/0d697870c8ea8fd894d49ddf3020101dfcc1131e/LibTerm/Commands/builtins/jsc.swift#L33
argv
is empty when there is no arguments, so this is probably an out-of-bounds exception.
I suggest an explicit check for when there are no args:
if argv.count == 0 {
fputs("jsc: Error: no file specified", thread_stderr)
executionDone = true
}
@oflebbe @onyxware Thanks. I'll fix that
typing "jsc" crashes libterm