summaryrefslogtreecommitdiff
path: root/graphics/pgf/base/tex/pgfmathfunctions.misc.code.tex
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/pgf/base/tex/pgfmathfunctions.misc.code.tex')
-rw-r--r--graphics/pgf/base/tex/pgfmathfunctions.misc.code.tex18
1 files changed, 11 insertions, 7 deletions
diff --git a/graphics/pgf/base/tex/pgfmathfunctions.misc.code.tex b/graphics/pgf/base/tex/pgfmathfunctions.misc.code.tex
index 6d1ec5b6ab..859d8266a9 100644
--- a/graphics/pgf/base/tex/pgfmathfunctions.misc.code.tex
+++ b/graphics/pgf/base/tex/pgfmathfunctions.misc.code.tex
@@ -272,17 +272,21 @@
\pgfmathdeclarefunction{dim}{1}{%
\begingroup
\pgfmath@count=0\relax
- \expandafter\pgfmath@dim@i\pgfutil@firstofone#1\pgfmath@token@stop
+ \expandafter\pgfmath@dim@i\pgfutil@firstofone#1{\pgfmath@token@stop}%
\edef\pgfmathresult{\the\pgfmath@count}%
\pgfmath@smuggleone\pgfmathresult%
\endgroup}
-\def\pgfmath@dim@i#1{%
- \ifx\pgfmath@token@stop#1%
- \else
- \advance\pgfmath@count by 1\relax
- \expandafter\pgfmath@dim@i
- \fi}
+\def\pgfmath@dim@i#1#{%
+ \pgfutil@ifempty{#1}{}{\advance\pgfmath@count by 1}%
+ \pgfmath@dim@ii{#1}}
+
+\def\pgfmath@dim@ii#1#2{%
+ \ifx\pgfmath@token@stop#2%
+ \else
+ \advance\pgfmath@count by 1\relax
+ \expandafter\pgfmath@dim@i
+ \fi}
% max function.