From fe2ada737510b91655bda3aac4f6385de6410c0d Mon Sep 17 00:00:00 2001 From: Ihor Antonov Date: Sun, 28 Jul 2019 15:28:53 -0400 Subject: [PATCH] PVS/V560: condition is always false #10638 * shorten_buf_name: condition inside outer if-branch with inverse condition --- src/nvim/fileio.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index 387475c9e2..907e6c978a 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -4248,15 +4248,13 @@ void shorten_buf_fname(buf_T *buf, char_u *dirname, int force) buf->b_sfname = vim_strsave(p); buf->b_fname = buf->b_sfname; } - if (p == NULL || buf->b_fname == NULL) { + if (p == NULL) { buf->b_fname = buf->b_ffname; } } } -/* - * Shorten filenames for all buffers. - */ +/// Shorten filenames for all buffers. void shorten_fnames(int force) { char_u dirname[MAXPATHL]; @@ -4265,8 +4263,8 @@ void shorten_fnames(int force) FOR_ALL_BUFFERS(buf) { shorten_buf_fname(buf, dirname, force); - /* Always make the swap file name a full path, a "nofile" buffer may - * also have a swap file. */ + // Always make the swap file name a full path, a "nofile" buffer may + // also have a swap file. mf_fullname(buf->b_ml.ml_mfp); } status_redraw_all();