Stability in the Erd\H{o}s--Gallai Theorem on cycles and paths, II