diff options
author | Taco Hoekwater <taco@elvenkind.com> | 2008-04-15 16:09:44 +0000 |
---|---|---|
committer | Taco Hoekwater <taco@elvenkind.com> | 2008-04-15 16:09:44 +0000 |
commit | 6e58fd80fec5c2c79af58e74ba6930ea07e461bc (patch) | |
tree | a26a23bf20b6420730504aae2e229f08b6ca8789 /Master/texmf-dist/metapost | |
parent | c5409cccadbcad6f11322d6fb1dd4fb4c9a05822 (diff) |
Metapost 1.003
git-svn-id: svn://tug.org/texlive/trunk@7425 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/metapost')
-rw-r--r-- | Master/texmf-dist/metapost/base/boxes.mp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Master/texmf-dist/metapost/base/boxes.mp b/Master/texmf-dist/metapost/base/boxes.mp index 7a70c7b6f14..bd2d73aef80 100644 --- a/Master/texmf-dist/metapost/base/boxes.mp +++ b/Master/texmf-dist/metapost/base/boxes.mp @@ -20,8 +20,7 @@ enddef; % Take a string returned by the str operator and return the same string % with explicit numeric subscripts replaced by generic subscript symbols []. % -% This new version makes sure that variables with '[[' in them are treated -% correctly. +% Fixed version supplied by Eddie Kohler vardef generisize (expr ss) = save res, s, stest, l; string res, s, stest; @@ -32,16 +31,16 @@ vardef generisize (expr ss) = res := res & substring (0,l) of s; s := substring (l,infinity) of s; if s<>"": - if s>="[": - stest := substring (0,1) of s; + if (s>="[") and (length s > 1): + stest := substring (1,2) of s; if stest="[": - l := 1; - res := res & "["; + l := 2; + res := res & "[["; else: l := 1 + str_prefix(s, c<>"]"); res := res & "[]"; fi - else: + else: res := res & "[]"; l := str_prefix(s, (c=".") or ("0"<=c) and (c<="9")); fi @@ -51,6 +50,7 @@ vardef generisize (expr ss) = res enddef; + % Make sure the string _n_gen_ is generisize(_n_): vardef set_n_gen_ = if _n_ <> _n_cur_: |