uri: fix behaviour for merging uris ending in .. without following /
authorFlorin Apostol <florin.apostol@oregan.net>
Sat, 24 Oct 2015 15:52:44 +0000 (16:52 +0100)
committerSebastian Dröge <sebastian@centricular.com>
Tue, 27 Oct 2015 15:09:53 +0000 (17:09 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=757065

gst/gsturi.c

index 3efaae341853a11b328b956bd45ca1a78bbe89ae..52f951b8b6a72843bfcf4123fbaba69634d554c1 100644 (file)
@@ -1238,7 +1238,12 @@ _remove_dot_segments (GList * path)
         out = g_list_delete_link (out, prev);
       }
       g_free (elem->data);
-      out = g_list_delete_link (out, elem);
+      if (next != NULL) {
+        out = g_list_delete_link (out, elem);
+      } else {
+        /* path ends in '/..' We need to keep the last '/' */
+        elem->data = NULL;
+      }
     }
   }