From c7a600063d4b9a5042821e1f95861ae7d7795569 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Tue, 20 Sep 2022 16:17:02 +0200 Subject: [PATCH] tweaks: reshuffle some lines, to be more readable instead of compact --- src/winio.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/winio.c b/src/winio.c index 904e9915..7ba04f9d 100644 --- 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]);