[buffer] refactor buffer_path_simplify (fixes #2560)
commit0a61fdecacd6196f44bde9a59a3d7fb6f8351cbe
authorStefan Bühler <stbuehler@web.de>
Fri, 25 Mar 2016 16:58:16 +0000 (25 16:58 +0000)
committerStefan Bühler <stbuehler@web.de>
Fri, 25 Mar 2016 16:58:16 +0000 (25 16:58 +0000)
tree53e03391bbbcd60b61ae929955b31728208fa84c
parent82bee8d5c38b7773eb8e1531142aaeb595cb118c
[buffer] refactor buffer_path_simplify (fixes #2560)

There actually was one bug: if the input consisted only of spaces,
it would read one byte too much.

`pre` was splitted into `pre2` and (already existing) `pre1` - the two
characters which were read before the current one in `c`.

Restructuring the loop eliminated some code before the loop, which was
similar to the one at the end of the loop.

From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3120 152afb58-edef-0310-8abb-c4023f1b3aa9
NEWS
src/buffer.c