diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-01-18 21:01:35 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-01-18 21:01:35 +0100 |
| commit | aaf443f64d36ad8f921d56387c806ae5fe1b7fa8 (patch) | |
| tree | 27e525097be8182ff3e6d9e51cf56a0426dce9f9 | |
| parent | 70c2ae4bea16a84e618d14a72a53602c401e75e1 (diff) | |
| download | vis-aaf443f64d36ad8f921d56387c806ae5fe1b7fa8.tar.gz vis-aaf443f64d36ad8f921d56387c806ae5fe1b7fa8.tar.xz | |
vis: fix segfault upon :qall
| -rw-r--r-- | vis-cmds.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -489,14 +489,16 @@ static bool cmd_bdelete(Vis *vis, Filerange *range, enum CmdOpt opt, const char static bool cmd_qall(Vis *vis, Filerange *range, enum CmdOpt opt, const char *argv[]) { for (Win *next, *win = vis->windows; win; win = next) { next = win->next; - if (!text_modified(vis->win->file->text) || (opt & CMD_OPT_FORCE)) + if (!win->file->internal && (!text_modified(win->file->text) || (opt & CMD_OPT_FORCE))) vis_window_close(win); } - if (!has_windows(vis)) + if (!has_windows(vis)) { vis_exit(vis, EXIT_SUCCESS); - else + return true; + } else { info_unsaved_changes(vis); - return vis->windows == NULL; + return false; + } } static bool cmd_read(Vis *vis, Filerange *range, enum CmdOpt opt, const char *argv[]) { |
