From 38c700a0915aa6cf6b2111f6ae72c584f16d4826 Mon Sep 17 00:00:00 2001
From: Holden Rohrer
Date: Mon, 18 May 2020 01:24:08 -0400
Subject: Removed an unnecessary goto and 3 lines
---
badroff.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/badroff.c b/badroff.c
index 6a630ed..3d96fc7 100644
--- a/badroff.c
+++ b/badroff.c
@@ -160,16 +160,13 @@ char* lineset(char* txt){
bool done = true; // if stays true, all strings are complete
llnode* orig = tail;
do { // check every string
- if (tail->end) goto iter;
- if (tail->str[i] == 0){
- tail->end = true;
- goto iter;
- } // ignore strings that have already finished
- done = false;
- if (tail->str[i] != ' ')
- valid = false;
- // doesn't break because tail needs to return to orig
- iter:
+ if (tail->str[i] == 0) tail->end = true;
+ // ignore strings that have already finished
+ else if (!tail->end){
+ done = false;
+ if (tail->str[i] != ' ') valid = false;
+ // can't break here because tail needs to return to orig
+ }
tail = tail->next;
} while (tail != orig);
if (valid) brk = i;
--
cgit