LearnBoost/stylus — pull request #1037 by RobertWHurst (2013-06-01 07:53:49+00:00)
Title: Correction for non symmetrical src and dest paths in middleware.

Corrects a flaw in path resolution for source files in stylus' middleware. See the following illustration:

Suppose we instance the middleware with the following dest and src paths.

dest: "./assets/css",
src: "./style"

Also assume the public directory is `./assets`. Now suppose a resource is requested; `/css/main.css`. The current implementation does not compare the dest path and the request path for overlap, instead it preforms a join. This produces incorrect src and dest file paths; a destination of `./assets/css/css/main.css`, and a source of `./style/css/main.css`.

This can be corrected by comparing the dest path to the request path; `./assets/css` and `/css/main.css`. By removing the overlapping `css` segment from the path, expected behaviour is obtained; a destination of `./assets/css/main.css`, and a source of `./style/main.css`

--

Thanks for your hard work on Stylus,
Its much appreciated.

- Robert