• Need help with removing dot segments

Question related to mission URL Normalization

 

If I apply the algorithm described in http://tools.ietf.org/html/rfc3986#section-5.2.4 to "/HOME/../././guest/1/../2/.." I get "/guest/" (with a trailing slash), not "/guest" as required by the unit tests:


STEP   OUTPUT BUFFER         INPUT BUFFER
 1 :   <empty>               /HOME/../././guest/1/../2/..
 2E:   /HOME                 /../././guest/1/../2/..
 2C:   <empty>               /././guest/1/../2/..
 2B:   <empty>               /./guest/1/../2/..
 2B:   <empty>               /guest/1/../2/..
 2E:   /guest                /1/../2/..
 2E:   /guest/1              /../2/..
 2C:   /guest                /2/..
 2E:   /guest/2              /..
 2C:   /guest                /
 2E:   /guest/

What am I doing wrong?