VTK-2073 - remove last '/' if not root and simplify for-loop-initialization
VTK-2073 - remove last '/' if not root and simplify for-loop-initialization

vtkio/vtk,vtkio/vtk,vtkio/vtk,vtkio/vtk,vtkio/vtk,vtkio/vtk,vtkio/vtk,vtkio/vtk