diff options
Diffstat (limited to 'src/nvim/memline.c')
-rw-r--r-- | src/nvim/memline.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/nvim/memline.c b/src/nvim/memline.c index 56342942db..da31235e74 100644 --- a/src/nvim/memline.c +++ b/src/nvim/memline.c @@ -437,7 +437,7 @@ void ml_open_file(buf_T *buf) if (buf->b_spell) { char *fname = vim_tempname(); if (fname != NULL) { - (void)mf_open_file(mfp, (char *)fname); // consumes fname! + (void)mf_open_file(mfp, fname); // consumes fname! } buf->b_may_swap = false; return; @@ -1193,7 +1193,7 @@ int recover_names(char_u *fname, int list, int nr, char **fname_out) // Isolate a directory name from *dirp and put it in dir_name (we know // it is large enough, so use 31000 for length). // Advance dirp to next directory name. - (void)copy_option_part(&dirp, (char *)dir_name, 31000, ","); + (void)copy_option_part(&dirp, dir_name, 31000, ","); if (dir_name[0] == '.' && dir_name[1] == NUL) { // check current dir if (fname == NULL) { @@ -1208,24 +1208,24 @@ int recover_names(char_u *fname, int list, int nr, char **fname_out) } } else { // check directory dir_name if (fname == NULL) { - names[0] = concat_fnames((char *)dir_name, "*.sw?", true); + names[0] = concat_fnames(dir_name, "*.sw?", true); // For Unix names starting with a dot are special. MS-Windows // supports this too, on some file systems. - names[1] = concat_fnames((char *)dir_name, ".*.sw?", true); - names[2] = concat_fnames((char *)dir_name, ".sw?", true); + names[1] = concat_fnames(dir_name, ".*.sw?", true); + names[2] = concat_fnames(dir_name, ".sw?", true); num_names = 3; } else { int len = (int)STRLEN(dir_name); p = dir_name + len; - if (after_pathsep((char *)dir_name, (char *)p) + if (after_pathsep(dir_name, p) && len > 1 && p[-1] == p[-2]) { // Ends with '//', Use Full path for swap name - tail = (char_u *)make_percent_swname((char *)dir_name, + tail = (char_u *)make_percent_swname(dir_name, (char *)fname_res); } else { tail = (char_u *)path_tail((char *)fname_res); - tail = (char_u *)concat_fnames((char *)dir_name, (char *)tail, true); + tail = (char_u *)concat_fnames(dir_name, (char *)tail, true); } num_names = recov_file_names(names, (char *)tail, false); xfree(tail); @@ -1262,7 +1262,7 @@ int recover_names(char_u *fname, int list, int nr, char **fname_out) for (int i = 0; i < num_files; i++) { // Do not expand wildcards, on Windows would try to expand // "%tmp%" in "%tmp%file" - if (path_full_compare((char *)p, files[i], true, false) & kEqualFiles) { + if (path_full_compare(p, files[i], true, false) & kEqualFiles) { // Remove the name from files[i]. Move further entries // down. When the array becomes empty free it here, since // FreeWild() won't be called below. @@ -1292,7 +1292,7 @@ int recover_names(char_u *fname, int list, int nr, char **fname_out) } } else { msg_puts(_(" In directory ")); - msg_home_replace((char *)dir_name); + msg_home_replace(dir_name); msg_puts(":\n"); } @@ -3485,7 +3485,7 @@ static void long_to_char(long n, char_u *s) s[3] = (char_u)(n & 0xff); } -static long char_to_long(char_u *s) +static long char_to_long(const char_u *s) { long retval; |