diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2023-01-14 12:32:28 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-01-14 12:32:28 +0000 |
commit | e8575988969579f9e1439181ae338b2ff74054a8 (patch) | |
tree | f4c8a1242cb67b073bb0e375740c764c2136af21 /src/mark.c | |
parent | 378e6c03f98efc88e8c2675e05a548f9bb7889a1 (diff) |
patch 9.0.1196: code is indented more than necessaryv9.0.1196
Problem: Code is indented more than necessary.
Solution: Use an early return where it makes sense. (Yegappan Lakshmanan,
closes #11813)
Diffstat (limited to 'src/mark.c')
-rw-r--r-- | src/mark.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/mark.c b/src/mark.c index 584db033d3..a7592e6077 100644 --- a/src/mark.c +++ b/src/mark.c @@ -485,34 +485,34 @@ fname2fnum(xfmark_T *fm) { char_u *p; - if (fm->fname != NULL) - { - /* - * First expand "~/" in the file name to the home directory. - * Don't expand the whole name, it may contain other '~' chars. - */ - if (fm->fname[0] == '~' && (fm->fname[1] == '/' + if (fm->fname == NULL) + return; + + /* + * First expand "~/" in the file name to the home directory. + * Don't expand the whole name, it may contain other '~' chars. + */ + if (fm->fname[0] == '~' && (fm->fname[1] == '/' #ifdef BACKSLASH_IN_FILENAME - || fm->fname[1] == '\\' + || fm->fname[1] == '\\' #endif - )) - { - int len; + )) + { + int len; - expand_env((char_u *)"~/", NameBuff, MAXPATHL); - len = (int)STRLEN(NameBuff); - vim_strncpy(NameBuff + len, fm->fname + 2, MAXPATHL - len - 1); - } - else - vim_strncpy(NameBuff, fm->fname, MAXPATHL - 1); + expand_env((char_u *)"~/", NameBuff, MAXPATHL); + len = (int)STRLEN(NameBuff); + vim_strncpy(NameBuff + len, fm->fname + 2, MAXPATHL - len - 1); + } + else + vim_strncpy(NameBuff, fm->fname, MAXPATHL - 1); - // Try to shorten the file name. - mch_dirname(IObuff, IOSIZE); - p = shorten_fname(NameBuff, IObuff); + // Try to shorten the file name. + mch_dirname(IObuff, IOSIZE); + p = shorten_fname(NameBuff, IObuff); - // buflist_new() will call fmarks_check_names() - (void)buflist_new(NameBuff, p, (linenr_T)1, 0); - } + // buflist_new() will call fmarks_check_names() + (void)buflist_new(NameBuff, p, (linenr_T)1, 0); } /* |