Branch: Tag:

2018-10-22

2018-10-22 12:25:15 by Henrik Grubbström (Grubba) <grubba@grubba.org>

combine_path: Fixed corner case.

combine_path() on strings starting with "./../" used to gain one
directory level. Eg:

Old behavior:
> combine_path(".", "../foo");
(1) Result: "../foo"
> combine_path("./..", "foo");
(2) Result: "foo"
> combine_path("./../foo");
(3) Result: "foo"

New (fixed) behavior:
> combine_path(".", "../foo");
(1) Result: "../foo"
> combine_path("./..", "foo");
(2) Result: "../foo"
> combine_path("./../foo");
(3) Result: "../foo"

Fixes PIKE-137 (#8137).

10750:   test_eq([[combine_path("./", "bar")]],"bar")   test_eq([[combine_path(".", "../bar")]],"../bar")   test_eq([[combine_path("./", "../bar")]],"../bar") + test_eq([[combine_path("./bar")]],"bar") + test_eq([[combine_path("./bar")]],"bar") + test_eq([[combine_path("./../bar")]],"../bar")      // - combine_path_nt   test_eq([[combine_path_nt("/","/fo\1111/bar/gazonk/../../")]],"/fo\1111/")