refactor: reduce scope of locals as per the style guide (#22211)

This commit is contained in:
dundargoc
2023-02-11 14:14:24 +01:00
committed by GitHub
parent 224a3c77ca
commit 27177e5819
25 changed files with 177 additions and 317 deletions

View File

@@ -276,10 +276,8 @@ static void source_callback(char *fname, void *cookie)
/// return FAIL when no file could be sourced, OK otherwise.
int do_in_path(char *path, char *name, int flags, DoInRuntimepathCB callback, void *cookie)
{
char *tail;
int num_files;
char **files;
int i;
bool did_one = false;
// Make a copy of 'runtimepath'. Invoking the callback may change the
@@ -287,6 +285,8 @@ int do_in_path(char *path, char *name, int flags, DoInRuntimepathCB callback, vo
char *rtp_copy = xstrdup(path);
char *buf = xmallocz(MAXPATHL);
{
char *tail;
int i;
if (p_verbose > 10 && name != NULL) {
verbose_enter();
smsg(_("Searching for \"%s\" in \"%s\""), name, path);
@@ -2329,7 +2329,6 @@ char *getsourceline(int c, void *cookie, int indent, bool do_concat)
{
struct source_cookie *sp = (struct source_cookie *)cookie;
char *line;
char *p;
// If breakpoints have been added/deleted need to check for it.
if (sp->dbg_tick < debug_tick) {
@@ -2359,6 +2358,7 @@ char *getsourceline(int c, void *cookie, int indent, bool do_concat)
// Only concatenate lines starting with a \ when 'cpoptions' doesn't
// contain the 'C' flag.
if (line != NULL && do_concat && (vim_strchr(p_cpo, CPO_CONCAT) == NULL)) {
char *p;
// compensate for the one line read-ahead
sp->sourcing_lnum--;