Allow overriding the default xslt path

It's very annoying to have to do "make install" to test a new xslt file,
just because the default xslt path has the standard install path as the
first entry.

At the same time, we do want to default to just using the standard
install location first.

So to allow both testing, and having a nice sane default, just add
support for a SUBSURFACE_XSLT_PATH environment variable that overrides
the default one if it exists.

So then you can just do

   SUBSURFACE_XSLT_PATH=xslt ./subsurface

to run subsurface from inside the git tree itself, using the current
files in the git xslt subdirectory.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Linus Torvalds 2012-05-12 12:53:41 -07:00
parent b2e4ca552f
commit 058b84cca0

View file

@ -1462,7 +1462,11 @@ static xsltStylesheetPtr try_get_stylesheet(const char *path, int len, const cha
static xsltStylesheetPtr get_stylesheet(const char *name)
{
const char *path = xslt_path, *next;
const char *path, *next;
path = getenv("SUBSURFACE_XSLT_PATH");
if (!path)
path = xslt_path;
do {
int len;