Skip to content

Commit

Permalink
Protect against comma in pgfkeys arguments pgf-tikz#389
Browse files Browse the repository at this point in the history
Co-authored-by: muzimuzhi <muzimuzhi@gmail.com>
Signed-off-by: Henri Menke <henri@henrimenke.de>
  • Loading branch information
hmenke and muzimuzhi committed Nov 10, 2021
1 parent a9a0a43 commit 1ec20cb
Show file tree
Hide file tree
Showing 21 changed files with 82 additions and 82 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@
},
circuit symbol unit/.code=\pgfmathsetlength\tikzcircuitssizeunit{#1},
circuit symbol size/.style args={width #1 height #2}{
minimum width=#1*\tikzcircuitssizeunit,
minimum height=#2*\tikzcircuitssizeunit
minimum width={(#1)*\tikzcircuitssizeunit},
minimum height={(#2)*\tikzcircuitssizeunit}
},
huge circuit symbols/.style={circuit symbol unit=10pt},
large circuit symbols/.style={circuit symbol unit=8pt},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,14 +245,14 @@
\tikz@lib@dv@handle@data@group@use{#1}{#2}}}}%

\def\tikz@lib@dv@handle@data@group@def#1#2={%
\pgfkeys{/pgf/data/new group=#2}%
\pgfkeys{/pgf/data/new group={#2}}%
\tikz@lib@dv@handle@data@group@extend{#1}{#2}+=%
}%

\def\tikz@lib@dv@handle@data@group@extend#1#2+={%
\pgfutil@ifnextchar\bgroup{
\begingroup%
\pgfkeys{/pgf/data/store in group=#2}%
\pgfkeys{/pgf/data/store in group={#2}}%
\pgf@dv@do@adddata{\pgfkeysvalueof{/pgf/data visualization/obj}.add data({{\begingroup\pgfkeys{/pgf/data/.cd,/pgf/every data/.try,#1}}})}%
\afterassignment\tikz@lib@dv@parse@loop%
\let\tikz@dummy=%get rid of \bgroup
Expand Down Expand Up @@ -423,7 +423,7 @@
store/.code=,% ignore
when/.code=,% ignore
class/.store in=\tikz@dv@new@class,
before creation/.code=#1,
before creation/.code={#1},
after creation/.store in=\tikz@dv@new@after,
arg1/.store in=\tikz@dv@arg@a,
arg2/.store in=\tikz@dv@arg@b,
Expand Down Expand Up @@ -507,7 +507,7 @@
arg3 from key=/tikz/data visualization/#1/scaling,
arg4 from key=/tikz/data visualization/#1/function
},
#1/attribute/.initial=#1,
#1/attribute/.initial={#1},
#1/function/.initial=,
#1/scaling/.initial=,
#1/scaling/default/.initial=0 at 0 and 1 at 1,
Expand Down Expand Up @@ -826,7 +826,7 @@
\def\tikz@lib@dv@special@at#1#2{%
% Ok, calculate direction vector:
\tikzpointandanchordirection{\pgfkeysvalueof{#1/scaling mapper}.set in to(min)}{\pgfkeysvalueof{#1/scaling mapper}.set in to(max)}
\tikzset{anchor/.expanded=#2}
\tikzset{anchor/.expanded={#2}}
}%


Expand Down Expand Up @@ -1436,9 +1436,9 @@
\tikzset{
/tikz/data visualization/axis options/.cd,
unit vector/.code=\tikz@scan@one@point\tikz@lib@dv@uv#1,
length/.style={\tikz@dv@axis/scaling=min at 0 and max at #1},
length/.style={\tikz@dv@axis/scaling=min at 0 and max at {#1}},
unit length/.code={\tikz@dv@parse@unit@length{#1}},
power unit length/.style={\tikz@dv@axis/scaling=1 at 0 and 10 at #1}
power unit length/.style={\tikz@dv@axis/scaling=1 at 0 and 10 at {#1}}
}%

\def\tikz@lib@dv@uv#1{%
Expand All @@ -1454,7 +1454,7 @@
\fi%
}%
\def\tikz@dv@parse@unit@length@#1per#2units\pgf@stop{
\pgfkeysalso{\tikz@dv@axis/scaling=0 at 0 and #2 at #1}
\pgfkeysalso{\tikz@dv@axis/scaling=0 at 0 and {#2} at {#1}}
}%


Expand All @@ -1467,7 +1467,7 @@
#1/.code={
\def\tikz@visualizer{#1}%
\pgfkeys{/tikz/data visualization/visualizer options/.cd,##1}
\pgf@dv@do@adddata{\pgfkeysvalueof{/pgf/data visualization/obj}.add data(\pgfkeys{/data point/set=#1})}%
\pgf@dv@do@adddata{\pgfkeysvalueof{/pgf/data visualization/obj}.add data(\pgfkeys{/data point/set={#1}})}%
},
/utils/exec={
\advance\tikzdvvisualizercounter by 1\relax
Expand All @@ -1491,7 +1491,7 @@
/tikz/data visualization/visualizers/#1/label in legend options/.style={#3},
},
style sheet/.style={/data point/set/.style sheet={#1}},
/pgf/data/set/.style={/data point/set=#1},
/pgf/data/set/.style={/data point/set={#1}},
}%

\tikzdatavisualizationset{
Expand Down Expand Up @@ -1521,7 +1521,7 @@

\def\tikz@do@visualizer#1#2{%
\tikzdatavisualizationset{
#2=#1
#2={#1}
}
}%

Expand Down Expand Up @@ -1568,7 +1568,7 @@
#2]
\tikzdatavisualizationset{every data set label/.try}
\path [
/data point/set=#1,/utils/exec=\pgf@signalstyle.emit(),
/data point/set={#1},/utils/exec=\pgf@signalstyle.emit(),
/tikz/data visualization/.cd,every label in data/.try]
(label visualizer coordinate') --
(label visualizer coordinate)
Expand Down Expand Up @@ -2038,7 +2038,7 @@
/tikz/.cd,
every label/.try,
/tikz/data visualization/legend entry options/.cd,
setup={/data point/set=#1},
setup={/data point/set={#1}},
/tikz/data visualization/visualizers/#1/label in legend options/.try,
#2,
}
Expand Down Expand Up @@ -2220,8 +2220,8 @@
%
%
visualizer options/.cd,
attribute 1/.style={/data point/\tikz@visualizer/attribute 1=#1},
attribute 2/.style={/data point/\tikz@visualizer/attribute 2=#1},
attribute 1/.style={/data point/\tikz@visualizer/attribute 1={#1}},
attribute 2/.style={/data point/\tikz@visualizer/attribute 2={#1}},
}%


Expand Down Expand Up @@ -2264,7 +2264,7 @@

\pgfdvdeclarestylesheet{vary thickness}
{
default style/.style={line width={0.3pt+#1*0.2pt}}
default style/.style={line width={0.3pt+(#1)*0.2pt}}
}%

\pgfdvdeclarestylesheet{vary dashing}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@

\pgfqkeys{/tikz/external}{
figure list/.is if=tikzexternal@genfigurelist,
aux in dpth/.style={/pgf/images/aux in dpth=#1},%
aux in dpth/.style={/pgf/images/aux in dpth={#1}},%
disable dependency files/.code={%
\let\tikzexternalfiledependsonfile@ACTIVE=\tikzexternalfiledependsonfile
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,8 @@
origin/.code=\tikz@anim@parse@origin{#1},
transform/.code=\tikz@anim@add{\pgfanimationset{transform={\let\tikz@transform\relax\tikzset{#1}}}},
along/.code=\tikz@anim@handle@along#1\pgf@stop,
entry control/.code=\tikz@anim@add{\pgfanimationset{entry control=#1}},
exit control/.code=\tikz@anim@add{\pgfanimationset{exit control=#1}},
entry control/.code=\tikz@anim@add{\pgfanimationset{entry control={#1}}},
exit control/.code=\tikz@anim@add{\pgfanimationset{exit control={#1}}},
stay/.code=\tikz@anim@add{\pgfanimationset{stay}},
jump/.code=\tikz@anim@add{\pgfanimationset{jump}},
ease/.style={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@
\xdef\tikzchaincurrent{#1-\the\c@pgf@counta}%
\expandafter\xdef\csname tikz@lib@chain@count@#1\endcsname{\the\c@pgf@counta}%
\ifnum\c@pgf@counta=1\relax%
\tikzset{alias/.expanded=#1-begin} % Define pseudostart
\tikzset{alias/.expanded={#1-begin}} % Define pseudostart
\fi%
\tikzset{alias/.expanded=#1-end} % Define pseudostart
\tikzset{alias/.expanded=#1-\the\c@pgf@counta} % Define pseudostart
\tikzset{alias/.expanded={#1-end}} % Define pseudostart
\tikzset{alias/.expanded={#1-\the\c@pgf@counta}} % Define pseudostart
\tikz@lib@chain@direction%
\tikzset{every on chain/.try}%
}%
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
\usepgflibrary{shapes.multipart}%

\pgfkeys{/tikz/rectangle split/parts/.code={%
\pgfkeys{/pgf/rectangle split parts=#1}%
\pgfkeys{/pgf/rectangle split parts={#1}}%
}%
}%

\pgfkeys{/tikz/rectangle split use custom fill/.code={%
\pgfkeys{/pgf/rectangle split use custom fill=#1}%
\pgfkeys{/pgf/rectangle split use custom fill={#1}}%
\pgfkeys{/tikz/fill=none}}%
}%

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
\let\tikz@lib@spy@collection=\pgfutil@empty%

\tikzset{spy scope/.style={
size/.style={minimum size=##1},
height/.style={minimum height=##1},
width/.style={minimum width=##1},
size/.style={minimum size={##1}},
height/.style={minimum height={##1}},
width/.style={minimum width={##1}},
execute at begin scope={%
\let\tikz@lib@spy@save=\tikz@lib@spy@collection%
\setbox\tikz@lib@spybox=\hbox\bgroup\bgroup%
Expand All @@ -58,7 +58,7 @@
},
lens/.store in=\tikz@lib@spy@lens,
lens=,
magnification/.style={lens={scale=#1}},
magnification/.style={lens={scale={#1}}},
spy connection path/.store in=\tikz@lib@spy@path,
spy connection path=
}%
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
% given, by turtle distance
\tikzset{
turtle/back/.default=\pgfkeysvalueof{/tikz/turtle/distance},
turtle/back/.style={turtle forward=-#1}
turtle/back/.style={turtle forward={-(#1)}}
}%


Expand Down Expand Up @@ -71,13 +71,13 @@

% Shortcuts:
\tikzset{turtle/.cd,
fd/.style={forward=#1},
fd/.style={forward={#1}},
fd/.default=\pgfkeysvalueof{/tikz/turtle/distance},
bk/.style={back=#1},
bk/.style={back={#1}},
bk/.default=\pgfkeysvalueof{/tikz/turtle/distance},
lt/.style={left=#1},
lt/.style={left={#1}},
lt/.default=90,
rt/.style={right=#1},
rt/.style={right={#1}},
rt/.default=90}%


Expand Down
12 changes: 6 additions & 6 deletions tex/generic/pgf/frontendlayer/tikz/tikz.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@
scope fading/.default=}%
\tikzset{fit fading/.is if=tikz@fade@adjust}%
\tikzset{fading transform/.store in=\tikz@fade@transform}%
\tikzset{fading angle/.style={fading transform={rotate=#1}}}%
\tikzset{fading angle/.style={fading transform={rotate={#1}}}}%

\newif\iftikz@fade@adjust%
\tikz@fade@adjusttrue%
Expand Down Expand Up @@ -1647,7 +1647,7 @@
% Setting keys
%

\pgfkeys{/tikz/style/.style=#1}%
\pgfkeys{/tikz/style/.style={#1}}%

\pgfkeys{/tikz/.unknown/.code=%
% Is it a pgf key?
Expand Down Expand Up @@ -5136,7 +5136,7 @@
\tikzset{cs/angle/.store in=\tikz@cs@angle}%
\tikzset{cs/x radius/.store in=\tikz@cs@xradius}%
\tikzset{cs/y radius/.store in=\tikz@cs@yradius}%
\tikzset{cs/radius/.style={/tikz/cs/x radius=#1,/tikz/cs/y radius=#1}}%
\tikzset{cs/radius/.style={/tikz/cs/x radius={#1},/tikz/cs/y radius={#1}}}%
\tikzset{cs/name/.store in=\tikz@cs@node}%
\tikzset{cs/anchor/.store in=\tikz@cs@anchor}%
Expand Down Expand Up @@ -5476,18 +5476,18 @@
}%
}%
\def\tikz@parse@main@intersection#1#2of #3 and #4){%
\tikzset{cs/solution=#2}%
\tikzset{cs/solution={#2}}%
\pgfutil@in@{--}{#3}%
\ifpgfutil@in@%
\tikz@reparse@line{first}#3\pgf@stop%
\else%
\tikzset{cs/first node=#3}%
\tikzset{cs/first node={#3}}%
\fi%
\pgfutil@in@{--}{#4}%
\ifpgfutil@in@%
\tikz@reparse@line{second}#4\pgf@stop%
\else%
\tikzset{cs/second node=#4}%
\tikzset{cs/second node={#4}}%
\fi%
\tikz@parse@cs@intersection()% advanced hackery...
\edef\pgf@marshal{\noexpand#1{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}}%
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,24 @@
shape scaled/.is if=pgfshapedecorationscaled,
shape evenly spread/.store in=\pgf@lib@shapedecoration@spread,
shape start size/.style={%
shape start width=#1,
shape start height=#1%
shape start width={#1},
shape start height={#1}%
},%
shape end size/.style={%
shape end width=#1,
shape end height=#1%
shape end width={#1},
shape end height={#1}%
},%
shape size/.style={%
shape start size=#1,
shape end size=#1%
shape start size={#1},
shape end size={#1}%
},%
shape width/.style={%
shape start width=#1,
shape end width=#1
shape start width={#1},
shape end width={#1}
},
shape height/.style={%
shape start height=#1,
shape end height=#1
shape start height={#1},
shape end height={#1}
}
}%

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},%
left angle/.code={\pgfmathparse{#1}\let\pgflsystemleftangle=\pgfmathresult},%
right angle/.code={\pgfmathparse{#1}\let\pgflsystemrightangle=\pgfmathresult},%
angle/.style={/pgf/lindenmayer system/left angle=#1, /pgf/lindenmayer system/right angle=#1},%
angle/.style={/pgf/lindenmayer system/left angle={#1}, /pgf/lindenmayer system/right angle={#1}},%
randomize angle percent/.code={%
\pgfmathparse{#1}%
\let\pgflsystemrandomizeanglepercent=\pgfmathresult%
Expand Down
2 changes: 1 addition & 1 deletion tex/generic/pgf/libraries/pgflibraryplotmarks.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@
% backw. compat: the extra search path confuses the '.unknown'
% handlers, so this here is deprecated:
/pgf/text mark/style/.style={/pgf/text mark style={#1}},%
/pgf/text mark/as node/.style={/pgf/text mark as node=#1},%
/pgf/text mark/as node/.style={/pgf/text mark as node={#1}},%
}%

\pgfdeclareplotmark{text}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
aspect/.code={\pgfsetshapeaspect{#1}},% this for tikz...
shape aspect/.initial=1,% but this is consistent with other pgfset stuff.
shape aspect/.code={%
\pgfkeys{/pgf/aspect=#1}%
\pgfkeys{/pgf/aspect={#1}}%
\pgfkeyssetvalue{/pgf/shape aspect}{#1}
}%
}%
Expand Down Expand Up @@ -369,7 +369,7 @@
\pgfkeyslet{/pgf/star point ratio}{\pgf@lib@temp}%
\pgf@lib@shapes@starouterradiususesratiotrue%
},%
star rotate/.style={/pgf/shape border rotate=#1},% For compatibility with 1.18
star rotate/.style={/pgf/shape border rotate={#1}},% For compatibility with 1.18
}%


Expand Down Expand Up @@ -676,7 +676,7 @@
%
\pgfkeys{/pgf/.cd,
regular polygon sides/.initial=5,
regular polygon rotate/.style={/pgf/shape border rotate=#1}% For compatibility with 1.18
regular polygon rotate/.style={/pgf/shape border rotate={#1}}% For compatibility with 1.18
}%


Expand Down Expand Up @@ -931,8 +931,8 @@
trapezium left angle/.initial=60,
trapezium right angle/.initial=60,
trapezium angle/.style={
/pgf/trapezium left angle=#1,
/pgf/trapezium right angle=#1
/pgf/trapezium left angle={#1},
/pgf/trapezium right angle={#1}
},%
trapezium stretches/.is if=pgf@lib@sh@trapeziumstretches,%
trapezium stretches body/.is if=pgf@lib@sh@trapeziumstretchesbody,%
Expand Down Expand Up @@ -2346,13 +2346,13 @@
\pgfutil@in@{and}{#1}%
\ifpgfutil@in@%
\def\pgf@marshal##1and##2\@@{%
\pgfkeys{/pgf/kite upper vertex angle=##1}%
\pgfkeys{/pgf/kite lower vertex angle=##2}%
\pgfkeys{/pgf/kite upper vertex angle={##1}}%
\pgfkeys{/pgf/kite lower vertex angle={##2}}%
}%
\expandafter\pgf@marshal#1\@@%
\else%
\pgfkeys{/pgf/kite upper vertex angle=#1}%
\pgfkeys{/pgf/kite lower vertex angle=#1}%
\pgfkeys{/pgf/kite upper vertex angle={#1}}%
\pgfkeys{/pgf/kite lower vertex angle={#1}}%
\fi%
}%
}%
Expand Down
Loading

0 comments on commit 1ec20cb

Please sign in to comment.