nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit c7a600063d4b9a5042821e1f95861ae7d7795569
parent 5b654ce9fb1c115871457b61eb003d70c832a720
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Tue, 20 Sep 2022 16:17:02 +0200

tweaks: reshuffle some lines, to be more readable instead of compact

Diffstat:
Msrc/winio.c | 21+++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/src/winio.c b/src/winio.c @@ -362,19 +362,24 @@ int get_code_from_plantation(void) commandname = measured_copy(plants_pointer + 1, closing - plants_pointer - 1); planted_shortcut = strtosc(commandname); - if (planted_shortcut) { - plants_pointer = closing + 1; - if (*plants_pointer != '\0') - put_back(MORE_PLANTS); - return PLANTED_COMMAND; - } else + if (!planted_shortcut) return NO_SUCH_FUNCTION; + + plants_pointer = closing + 1; + + if (*plants_pointer != '\0') + put_back(MORE_PLANTS); + + return PLANTED_COMMAND; } else { char *opening = strchr(plants_pointer, '{'); - int length = (opening ? opening - plants_pointer : strlen(plants_pointer)); + int length; - if (opening) + if (opening) { + length = opening - plants_pointer; put_back(MORE_PLANTS); + } else + length = strlen(plants_pointer); for (int index = length - 1; index >= 0; index--) put_back((unsigned char)plants_pointer[index]);