aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-06-17 20:26:02 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-06-17 20:26:13 +0200
commit8ac38f574a96c57615e1047d033ad5b6d38d37f9 (patch)
treee57cf16218ffb12f2223c226010e48578a3d269f
parent85343762e6e382cd0b746893ac03275cd4d791ad (diff)
downloadmk-8ac38f574a96c57615e1047d033ad5b6d38d37f9.tar.gz
g.tmac: Fix environment stack underflow
-rw-r--r--g.tmac41
1 files changed, 20 insertions, 21 deletions
diff --git a/g.tmac b/g.tmac
index f325daa..eb17536 100644
--- a/g.tmac
+++ b/g.tmac
@@ -1,30 +1,29 @@
.eo
-.\" s -- setup document (configurable)
-.de s
-.sp 1i
-._d t \" title
-. ps +4p
-. vs +2p
-. ft B
-. ad c
-._d
-._d n \" name (of author)
-. ad c
-._d
-._d d \" date
-. ad c
-._d
-._d p \" paragraph
-. ad b
-._d
+.\" _s -- setup document (configurable)
+.de _s
+. sp 1i
+. _d t \" title
+. ps +4p
+. vs +2p
+. ft B
+. ad c
+. _d n \" name (of author)
+. ad c
+. _d d \" date
+. ad c
+. _d p \" paragraph
+. ad b
+. _d
..
.\" _d -- define environment
.de _d
-. ev \$1
+. if !'\n[.ev]'0' .ev
+. if !'\$1'' .ev \$1
..
.\" _e -- enter environment
.de _e
-. ev
+.br
+. if !'\n[.ev]'0' .ev
. ds penv \*[env]
. ds env \$1
. ev \$1
@@ -70,4 +69,4 @@
\$3\f(BI\$1\fP\$2
..
.ec
-.s
+._s