nodejs / node-v0.x-archive

Moved to https://github.com/nodejs/node
34.46k stars 7.32k forks source link

Bug in require("../foo") #30

Closed jasondavies closed 14 years ago

jasondavies commented 14 years ago

I noticed a bug introduced in ry@3b8e47755a16c72d7b3509685a89c834c42a9342 whereby require("../foo") fails to work. The problem is that paths like "foo/bar/../baz" get turned into "foobaz" instead of "foo/baz".

Discussion thread here: http://groups.google.com/group/nodejs/browse_thread/thread/34779f8c10098c5e

Isaac Schlueter kindly took my original fix (jasondavies@79efd868c460df001b2602e133e6f3f57c337356) and rewrote it to avoid using regexps and added tests: http://gist.github.com/260278

ry commented 14 years ago

fixed in 4dcdfaf9291a5d6a2ed25b5742151a0de562a4a1