Redundand lineto commands

Migrated from https://bugs.launchpad.net/inkscape/+bug/1778145, Part 1/2

Steps to reproduce:

  • open Inkscape
  • create a path with 3 nodes (A, B, C)
  • snap the middle node (B) to the node (C)
  • snap the node (A) to the node (C)

What happened?

A path like this is created: m 421.67952,603.86854 v 0 0

What should have happened?

The duplicate 0 in the end is unnecessary. This would be just a minor annoyance, but #1674 (moved) makes it really hard to select the object again.

Inkscape Version and Operating System:

  • Inkscape Version: 1.1-dev (2a5d477, 2020-01-18)
  • Operating System: Windows 10
  • Operating System version: 10.0.18362