gbranden pushed a commit to branch master
in repository groff.

commit 236900705dec2fd0062a93a500d151bae5341820
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Nov 23 10:14:00 2026 -0600

    [troff]: `ev` returns early on error (2/2).
    
    * src/roff/troff/env.cpp (environment_switch_request): Reïndent.
---
 src/roff/troff/env.cpp | 50 +++++++++++++++++++++++++-------------------------
 1 file changed, 25 insertions(+), 25 deletions(-)

diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index df23790d8..220959e99 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -3952,33 +3952,33 @@ static void environment_switch_request() // .ev
     skip_line();
     return;
   }
-    symbol nm = read_long_identifier();
-    if (nm.is_null()) {
-      if (env_stack == 0 /* nullptr */)
-       error("cannot pop the only environment in the stack");
-      else {
-       bool seen_space = curenv->seen_space;
-       bool seen_eol   = curenv->seen_eol;
-       bool suppress_next_eol = curenv->suppress_next_eol;
-       curenv = env_stack->env;
-       curenv->seen_space = seen_space;
-       curenv->seen_eol   = seen_eol;
-       curenv->suppress_next_eol = suppress_next_eol;
-       env_list_node *tem = env_stack;
-       env_stack = env_stack->next;
-       delete tem;
-      }
-    }
+  symbol nm = read_long_identifier();
+  if (nm.is_null()) {
+    if (env_stack == 0 /* nullptr */)
+      error("cannot pop the only environment in the stack");
     else {
-      environment *e
-       = static_cast<environment *>(env_dictionary.lookup(nm));
-      if (!e) {
-       e = new environment(nm);
-       (void) env_dictionary.lookup(nm, e);
-      }
-      env_stack = new env_list_node(curenv, env_stack);
-      curenv = e;
+      bool seen_space = curenv->seen_space;
+      bool seen_eol   = curenv->seen_eol;
+      bool suppress_next_eol = curenv->suppress_next_eol;
+      curenv = env_stack->env;
+      curenv->seen_space = seen_space;
+      curenv->seen_eol   = seen_eol;
+      curenv->suppress_next_eol = suppress_next_eol;
+      env_list_node *tem = env_stack;
+      env_stack = env_stack->next;
+      delete tem;
     }
+  }
+  else {
+    environment *e
+      = static_cast<environment *>(env_dictionary.lookup(nm));
+    if (!e) {
+      e = new environment(nm);
+      (void) env_dictionary.lookup(nm, e);
+    }
+    env_stack = new env_list_node(curenv, env_stack);
+    curenv = e;
+  }
   skip_line();
 }
 

_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to