static struct { int baselen; .... } store; int git_config_rename_section_in_file(const char *new_name,....) { while (....) { char *output = buf; .... store.baselen = strlen(new_name); .... if (strlen(output) > 0) .... } }