Mercurial > vim
comparison src/undo.c @ 13244:ac42c4b11dbc v8.0.1496
patch 8.0.1496: clearing a pointer takes two lines
commit https://github.com/vim/vim/commit/d23a823669d93fb2a570a039173eefe4856ac806
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Feb 10 18:45:26 2018 +0100
patch 8.0.1496: clearing a pointer takes two lines
Problem: Clearing a pointer takes two lines.
Solution: Add VIM_CLEAR() and replace vim_clear(). (Hirohito Higashi,
closes #2629)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 10 Feb 2018 19:00:07 +0100 |
parents | 0f906f414c69 |
children | 69517d67421f |
comparison
equal
deleted
inserted
replaced
13243:899b19739188 | 13244:ac42c4b11dbc |
---|---|
847 | 847 |
848 /* When reading check if the file exists. */ | 848 /* When reading check if the file exists. */ |
849 if (undo_file_name != NULL && (!reading | 849 if (undo_file_name != NULL && (!reading |
850 || mch_stat((char *)undo_file_name, &st) >= 0)) | 850 || mch_stat((char *)undo_file_name, &st) >= 0)) |
851 break; | 851 break; |
852 vim_free(undo_file_name); | 852 VIM_CLEAR(undo_file_name); |
853 undo_file_name = NULL; | |
854 } | 853 } |
855 | 854 |
856 vim_free(munged_name); | 855 vim_free(munged_name); |
857 return undo_file_name; | 856 return undo_file_name; |
858 } | 857 } |
3452 void | 3451 void |
3453 u_clearline(void) | 3452 u_clearline(void) |
3454 { | 3453 { |
3455 if (curbuf->b_u_line_ptr != NULL) | 3454 if (curbuf->b_u_line_ptr != NULL) |
3456 { | 3455 { |
3457 vim_free(curbuf->b_u_line_ptr); | 3456 VIM_CLEAR(curbuf->b_u_line_ptr); |
3458 curbuf->b_u_line_ptr = NULL; | |
3459 curbuf->b_u_line_lnum = 0; | 3457 curbuf->b_u_line_lnum = 0; |
3460 } | 3458 } |
3461 } | 3459 } |
3462 | 3460 |
3463 /* | 3461 /* |