diff --git a/src/interpreter/computer.rs b/src/interpreter/computer.rs index 1d7f3a5..158f14d 100644 --- a/src/interpreter/computer.rs +++ b/src/interpreter/computer.rs @@ -54,13 +54,12 @@ impl Computer { fn init_stack(&mut self) -> Result<(), InterpreterError> { let mut args = Args::parse(); + // cant panic, as we would not be here without a valid binary path... + let path = &args.path.unwrap(); // set executable name as argv[0] - let path = &args.path.unwrap(); - let filename = Path::new(path).file_name().unwrap().to_str().unwrap(); - + let mut argv = Vec::from([path.clone()]); // add the rest of the arguements argv[1], ... - let mut argv = Vec::from([filename.to_string()]); argv.append(&mut args.argv); // set default env