Mercurial > vim
comparison src/version.c @ 31827:1009c33499e7 v9.0.1246
patch 9.0.1246: code is indented more than necessary
Commit: https://github.com/vim/vim/commit/142ed77898facf8f423fee2717efee1749c55f9a
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Thu Jan 26 12:00:00 2023 +0000
patch 9.0.1246: code is indented more than necessary
Problem: Code is indented more than necessary.
Solution: Use an early return where it makes sense. (Yegappan Lakshmanan,
closes #11887)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 26 Jan 2023 13:15:04 +0100 |
parents | 0d27ddce621d |
children | 2a590b4a3fba |
comparison
equal
deleted
inserted
replaced
31826:06619adfbcdd | 31827:1009c33499e7 |
---|---|
55 char *longVersion = NULL; | 55 char *longVersion = NULL; |
56 | 56 |
57 void | 57 void |
58 init_longVersion(void) | 58 init_longVersion(void) |
59 { | 59 { |
60 if (longVersion != NULL) | |
61 return; | |
62 | |
63 #ifdef BUILD_DATE | |
64 char *date_time = BUILD_DATE; | |
65 #else | |
66 char *date_time = __DATE__ " " __TIME__; | |
67 #endif | |
68 char *msg = _("%s (%s, compiled %s)"); | |
69 size_t len = strlen(msg) | |
70 + strlen(VIM_VERSION_LONG_ONLY) | |
71 + strlen(VIM_VERSION_DATE_ONLY) | |
72 + strlen(date_time); | |
73 | |
74 longVersion = alloc(len); | |
60 if (longVersion == NULL) | 75 if (longVersion == NULL) |
61 { | 76 longVersion = VIM_VERSION_LONG; |
62 #ifdef BUILD_DATE | 77 else |
63 char *date_time = BUILD_DATE; | 78 vim_snprintf(longVersion, len, msg, |
64 #else | 79 VIM_VERSION_LONG_ONLY, VIM_VERSION_DATE_ONLY, date_time); |
65 char *date_time = __DATE__ " " __TIME__; | |
66 #endif | |
67 char *msg = _("%s (%s, compiled %s)"); | |
68 size_t len = strlen(msg) | |
69 + strlen(VIM_VERSION_LONG_ONLY) | |
70 + strlen(VIM_VERSION_DATE_ONLY) | |
71 + strlen(date_time); | |
72 | |
73 longVersion = alloc(len); | |
74 if (longVersion == NULL) | |
75 longVersion = VIM_VERSION_LONG; | |
76 else | |
77 vim_snprintf(longVersion, len, msg, | |
78 VIM_VERSION_LONG_ONLY, VIM_VERSION_DATE_ONLY, date_time); | |
79 } | |
80 } | 80 } |
81 # endif | 81 # endif |
82 #else | 82 #else |
83 char *longVersion = VIM_VERSION_LONG; | 83 char *longVersion = VIM_VERSION_LONG; |
84 | 84 |
693 NULL | 693 NULL |
694 }; | 694 }; |
695 | 695 |
696 static int included_patches[] = | 696 static int included_patches[] = |
697 { /* Add new patch number below this line */ | 697 { /* Add new patch number below this line */ |
698 /**/ | |
699 1246, | |
698 /**/ | 700 /**/ |
699 1245, | 701 1245, |
700 /**/ | 702 /**/ |
701 1244, | 703 1244, |
702 /**/ | 704 /**/ |