On Sat, Mar 28, 2015 at 04:54:13PM +0100, Silvan Jegen wrote: > When using the ZQ/ZZ keybindings we end up writing to a string literal > which results in a sigsegv. In order to avoid that we have to copy the > command name string. > > Signed-off-by: Silvan Jegen <[email protected]> > --- > Heyhey > > With this solution to the problem we end up copying all command names > which I do not like. A better approach would probably be to use function > pointer *func of struct KeyBinding for ZZ/ZQ to just exit the editor > (with or without saving) instead of using cmd -> exec_command -> > exec_cmdline_command.
I'm in the process of separating the ui related code and generally providing a more library like interface to the the vis core, exec_command should thus take a const pointer and not modify its argument. While I agree the copying is somewhat ugly it is probably the right thing to do. -- Marc André Tanner >< http://www.brain-dump.org/ >< GPG key: CF7D56C0
