Backout bug 849797 - resPathComponents[endBasePos] is undefined. r=mmecca