I don't know if I am right. Let's read the codes :)
\setbox0=\vbox{a\par
\vskip2pt
\kern2pt
b}
\showbox0
the snippet of the log file:
.\glue 2.0
.\kern 2.0
.\glue(\parskip) 0.0 plus 1.0
.\glue(\baselineskip) 5.05556
When we
\setbox1=\vbox{\unvbox0
\setbox2=\lastbox
\unskip
\unskip
\global\skip0=\lastkern
\unkern
\global\skip1=\lastskip
\unskip}
Sometimes, we have no chance of examining the log file, so, how can we decide the glue or the kern in some \skip<number> is glue or kern?
\lastnodetype(texdoc etexis your friend). – egreg Mar 31 '13 at 13:41pdftexforetex,pdftex,latexandpdflatex. – egreg Mar 31 '13 at 13:50\global\skip1=\lastkernand\global\skip3=\lastskip). This is the convention in plain TeX and LaTeX to prevent problems with "save stack buildup". – Heiko Oberdiek Mar 31 '13 at 15:00