<html>
<body>
  <div id="body" style="background-color:#ffffff;" >
<table cellspacing="0" cellpadding="0" border="0" rules="cols">
<tr class="head" style="border-bottom-width:1px;border-bottom-style:solid;" ><td class="headtd" style="padding:0;padding-top:.2em;" colspan="4">Commit in <b><tt>lxdream/src</tt></b></td></tr>
<tr><td><tt><a href="#file1">Makefile.am</a></tt></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+4</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-2</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">c4b725d901b1 -> a486ac64f34b</td></tr>
<tr class="alt" style=";" ><td><tt><a href="#file2">Makefile.in</a></tt></td><td id="addedalt" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ccf7cc;" align="right">+31</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-6</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">c4b725d901b1 -> a486ac64f34b</td></tr>
<tr><td><tt><a href="#file3">lxpaths.c</a></tt></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+70</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-29</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">c4b725d901b1 -> a486ac64f34b</td></tr>
<tr class="alt" style=";" ><td><tt><a href="#file4">lxpaths.h</a></tt></td><td id="addedalt" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ccf7cc;" align="right">+2</td><td></td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">c4b725d901b1 -> a486ac64f34b</td></tr>
<tr><td><tt>pvr2/<a href="#file5">glrender.c</a></tt></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+4</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-4</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">c4b725d901b1 -> a486ac64f34b</td></tr>
<tr class="alt" style=";" ><td><tt>test/<a href="#file6"><span id="addedalt" style="background-color:#ccf7cc;" >testlxpaths.c</span></a></tt></td><td id="addedalt" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ccf7cc;" align="right">+105</td><td></td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" align="right" nowrap="nowrap">added a486ac64f34b</td></tr>
<tr><td></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+216</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-41</td><td></td></tr>
</table>
<small id="info" style="color: #888888;" >1 added + 5 modified, total 6 files</small><br />
<div class="tasklist" style="padding:4px;border:1px dashed #000000;margin-top:1em;" ><ul>
<li><a href="#task1">FIXME: Should probably restore the env state, but doesn't matter at the moment */</a></li>
</ul></div>
<pre class="comment" style="white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;white-space:pre-wrap;word-wrap:break-word;padding:4px;border:1px dashed #000000;background-color:#ffffdd;" >
Replace wordexp() with a hand-coded env-var substitution. More portable, and
avoids bugs with some wordexp() implementations
</pre>
<hr /><a name="file1" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream/src</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>Makefile.am</b></big> <small id="info" style="color: #888888;" >c4b725d901b1 -> a486ac64f34b</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/Makefile.am
+++ lxdream/src/Makefile.am
@@ -13,7 +13,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > PLUGINLDFLAGS = @PLUGINLDFLAGS@
 bin_PROGRAMS = lxdream
 noinst_PROGRAMS = gendec genglsl genmach
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-check_PROGRAMS = test/testxlt
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+check_PROGRAMS = test/testxlt test/testlxpaths
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
 pkglib_PROGRAMS=
 EXTRA_DIST=drivers/genkeymap.pl checkver.pl drivers/dummy.c
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -25,7 +25,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
 version.c: checkversion
 
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-TESTS = test/testxlt
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+TESTS = test/testxlt test/testlxpaths
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > BUILT_SOURCES = sh4/sh4core.c sh4/sh4dasm.c sh4/sh4x86.c sh4/sh4stat.c \
        pvr2/shaders.def pvr2/shaders.h drivers/mac_keymap.h version.c
 CLEANFILES = sh4/sh4core.c sh4/sh4dasm.c sh4/sh4x86.c sh4/sh4stat.c \
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -240,6 +240,8 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
 
 test_testxlt_SOURCES = test/testxlt.c xlat/xltcache.c xlat/xltcache.h
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+test_testlxpaths_SOURCES = test/testlxpaths.c lxpaths.c
+test_testlxpaths_LDADD = @GLIB_LIBS@
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
 sh4/sh4core.c: gendec$(EXEEXT) sh4/sh4.def sh4/sh4core.in
        $(mkdir_p) `dirname $@`
</pre></div>
<hr /><a name="file2" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream/src</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>Makefile.in</b></big> <small id="info" style="color: #888888;" >c4b725d901b1 -> a486ac64f34b</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/Makefile.in
+++ lxdream/src/Makefile.in
@@ -38,7 +38,8 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > host_triplet = @host@
 bin_PROGRAMS = lxdream$(EXEEXT)
 noinst_PROGRAMS = gendec$(EXEEXT) genglsl$(EXEEXT) genmach$(EXEEXT)
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-check_PROGRAMS = test/testxlt$(EXEEXT) $(am__EXEEXT_1)
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+check_PROGRAMS = test/testxlt$(EXEEXT) test/testlxpaths$(EXEEXT) \
+       $(am__EXEEXT_1)
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > pkglib_PROGRAMS = $(am__EXEEXT_2) $(am__EXEEXT_3) $(am__EXEEXT_4) \
        $(am__EXEEXT_5) $(am__EXEEXT_6) $(am__EXEEXT_7)
 @BUILD_SHARED_TRUE@am__append_1 = plugin.c plugin.h
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -297,6 +298,10 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > lxdream_dummy_@SOEXT@_OBJECTS = $(am_lxdream_dummy_@SOEXT@_OBJECTS)
 @BUILD_SHARED_TRUE@lxdream_dummy_@SOEXT@_DEPENDENCIES =  \
 @BUILD_SHARED_TRUE@    lxdream_dummy.lo
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+am_test_testlxpaths_OBJECTS = testlxpaths.$(OBJEXT) lxpaths.$(OBJEXT)
+test_testlxpaths_OBJECTS = $(am_test_testlxpaths_OBJECTS)
+test_testlxpaths_DEPENDENCIES =
+am__dirstamp = $(am__leading_dot)dirstamp
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > am__test_testsh4x86_SOURCES_DIST = test/testsh4x86.c x86dasm/x86dasm.c \
        x86dasm/x86dasm.h x86dasm/i386-dis.c x86dasm/dis-init.c \
        x86dasm/dis-buf.c sh4/sh4trans.c sh4/sh4x86.c xlat/xltcache.c \
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -316,7 +321,6 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > @BUILD_SH4X86_TRUE@  test_testsh4x86-cpu.$(OBJEXT)
 test_testsh4x86_OBJECTS = $(am_test_testsh4x86_OBJECTS)
 test_testsh4x86_DEPENDENCIES =
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-am__dirstamp = $(am__leading_dot)dirstamp
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > am_test_testxlt_OBJECTS = testxlt.$(OBJEXT) xltcache.$(OBJEXT)
 test_testxlt_OBJECTS = $(am_test_testxlt_OBJECTS)
 test_testxlt_LDADD = $(LDADD)
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -336,14 +340,14 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >      $(audio_pulse_@SOEXT@_SOURCES) $(audio_sdl_@SOEXT@_SOURCES) \
        $(gendec_SOURCES) $(genglsl_SOURCES) $(genmach_SOURCES) \
        $(input_lirc_@SOEXT@_SOURCES) $(lxdream_SOURCES) \
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-   $(lxdream_dummy_@SOEXT@_SOURCES) $(test_testsh4x86_SOURCES) \
-       $(test_testxlt_SOURCES)
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+     $(lxdream_dummy_@SOEXT@_SOURCES) $(test_testlxpaths_SOURCES) \
+       $(test_testsh4x86_SOURCES) $(test_testxlt_SOURCES)
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > DIST_SOURCES = $(audio_alsa_@SOEXT@_SOURCES) \
        $(audio_esd_@SOEXT@_SOURCES) $(audio_pulse_@SOEXT@_SOURCES) \
        $(audio_sdl_@SOEXT@_SOURCES) $(gendec_SOURCES) \
        $(genglsl_SOURCES) $(genmach_SOURCES) \
        $(input_lirc_@SOEXT@_SOURCES) $(am__lxdream_SOURCES_DIST) \
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-   $(lxdream_dummy_@SOEXT@_SOURCES) \
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+     $(lxdream_dummy_@SOEXT@_SOURCES) $(test_testlxpaths_SOURCES) \
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >    $(am__test_testsh4x86_SOURCES_DIST) $(test_testxlt_SOURCES)
 ETAGS = etags
 CTAGS = ctags
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -555,7 +559,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
 EXTRA_DIST = drivers/genkeymap.pl checkver.pl drivers/dummy.c
 AM_CFLAGS = -D__EXTENSIONS__ -D_BSD_SOURCE -D_GNU_SOURCE
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-TESTS = test/testxlt
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+TESTS = test/testxlt test/testlxpaths
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > BUILT_SOURCES = sh4/sh4core.c sh4/sh4dasm.c sh4/sh4x86.c sh4/sh4stat.c \
        pvr2/shaders.def pvr2/shaders.h drivers/mac_keymap.h version.c
 
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -647,6 +651,8 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > genglsl_LDADD = @GLIB_LIBS@ @GTK_LIBS@ $(INTLLIBS)
 genmach_LDADD = @GLIB_LIBS@ @GTK_LIBS@ $(INTLLIBS)
 test_testxlt_SOURCES = test/testxlt.c xlat/xltcache.c xlat/xltcache.h
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+test_testlxpaths_SOURCES = test/testlxpaths.c lxpaths.c
+test_testlxpaths_LDADD = @GLIB_LIBS@
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > all: $(BUILT_SOURCES)
        $(MAKE) $(AM_MAKEFLAGS) all-am
 
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -766,6 +772,9 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > test/$(am__dirstamp):
        @$(mkdir_p) test
        @: > test/$(am__dirstamp)
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+test/testlxpaths$(EXEEXT): $(test_testlxpaths_OBJECTS) $(test_testlxpaths_DEPENDENCIES) test/$(am__dirstamp)
+       @rm -f test/testlxpaths$(EXEEXT)
+       $(LINK) $(test_testlxpaths_LDFLAGS) $(test_testlxpaths_OBJECTS) $(test_testlxpaths_LDADD) $(LIBS)
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > test/testsh4x86$(EXEEXT): $(test_testsh4x86_OBJECTS) $(test_testsh4x86_DEPENDENCIES) test/$(am__dirstamp)
        @rm -f test/testsh4x86$(EXEEXT)
        $(LINK) $(test_testsh4x86_LDFLAGS) $(test_testsh4x86_OBJECTS) $(test_testsh4x86_LDADD) $(LIBS)
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -906,6 +915,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lxdream-x86dasm.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lxdream-xltcache.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lxdream-yuv.Po@am__quote@
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lxpaths.Po@am__quote@
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mdparse.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_testsh4x86-cpu.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_testsh4x86-dis-buf.Po@am__quote@
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -919,6 +929,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_testsh4x86-util.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_testsh4x86-x86dasm.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_testsh4x86-xltcache.Po@am__quote@
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testlxpaths.Po@am__quote@
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testxlt.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xltcache.Po@am__quote@
 
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -2560,6 +2571,20 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > @AMDEP_TRUE@@am__fastdepCC_FALSE@    DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lxdream_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lxdream-joy_linux.obj `if test -f 'drivers/joy_linux.c'; then $(CYGPATH_W) 'drivers/joy_linux.c'; else $(CYGPATH_W) '$(srcdir)/drivers/joy_linux.c'; fi`
 
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+testlxpaths.o: test/testlxpaths.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT testlxpaths.o -MD -MP -MF "$(DEPDIR)/testlxpaths.Tpo" -c -o testlxpaths.o `test -f 'test/testlxpaths.c' || echo '$(srcdir)/'`test/testlxpaths.c; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/testlxpaths.Tpo" "$(DEPDIR)/testlxpaths.Po"; else rm -f "$(DEPDIR)/testlxpaths.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='test/testlxpaths.c' object='testlxpaths.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o testlxpaths.o `test -f 'test/testlxpaths.c' || echo '$(srcdir)/'`test/testlxpaths.c
+
+testlxpaths.obj: test/testlxpaths.c
+@am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT testlxpaths.obj -MD -MP -MF "$(DEPDIR)/testlxpaths.Tpo" -c -o testlxpaths.obj `if test -f 'test/testlxpaths.c'; then $(CYGPATH_W) 'test/testlxpaths.c'; else $(CYGPATH_W) '$(srcdir)/test/testlxpaths.c'; fi`; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/testlxpaths.Tpo" "$(DEPDIR)/testlxpaths.Po"; else rm -f "$(DEPDIR)/testlxpaths.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='test/testlxpaths.c' object='testlxpaths.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o testlxpaths.obj `if test -f 'test/testlxpaths.c'; then $(CYGPATH_W) 'test/testlxpaths.c'; else $(CYGPATH_W) '$(srcdir)/test/testlxpaths.c'; fi`
+
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > test_testsh4x86-testsh4x86.o: test/testsh4x86.c
 @am__fastdepCC_TRUE@   if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_testsh4x86_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_testsh4x86-testsh4x86.o -MD -MP -MF "$(DEPDIR)/test_testsh4x86-testsh4x86.Tpo" -c -o test_testsh4x86-testsh4x86.o `test -f 'test/testsh4x86.c' || echo '$(srcdir)/'`test/testsh4x86.c; \
 @am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/test_testsh4x86-testsh4x86.Tpo" "$(DEPDIR)/test_testsh4x86-testsh4x86.Po"; else rm -f "$(DEPDIR)/test_testsh4x86-testsh4x86.Tpo"; exit 1; fi
</pre></div>
<hr /><a name="file3" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream/src</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>lxpaths.c</b></big> <small id="info" style="color: #888888;" >c4b725d901b1 -> a486ac64f34b</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/lxpaths.c
+++ lxdream/src/lxpaths.c
@@ -18,7 +18,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
 #include <ctype.h>
 #include <unistd.h>
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-#include <<span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >wordexp</span>.h>
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+#include <<span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >stdlib</span>.h>
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > #include <glib/gstrfuncs.h>
 #include <glib/gutils.h>
 
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -72,37 +72,78 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
 gchar *get_expanded_path( const gchar *input )
 {
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-    wordexp_t we;
-    if( input == NULL ) {
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    char result[PATH_MAX];
+
+    char *d, *e;
+    const char *s;
+    d = result;
+    e = result+sizeof(result)-1;
+    s = input;
+
+    if( input == NULL )
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         return NULL;
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+
+    while( *s ) {
+        if( d == e ) {
+            return g_strdup(input); /* expansion too long */
+        }
+        char c = *s++;
+        if( c == '$' ) {
+            if( *s == '{' ) {
+                s++;
+                const char *q = s;
+                while( *q != '}' ) {
+                    if( ! *q ) {
+                        return g_strdup(input); /* unterminated variable */
+                    }
+                    q++;
+                }
+                char *tmp = g_strndup(s, (q-s));
+                s = q+1;
+                char *value = getenv(tmp);
+                g_free(tmp);
+                if( value != NULL ) {
+                    int len = strlen(value);
+                    if( d + len > e )
+                        return g_strdup(input);
+                    strcpy(d, value);
+                    d+=len;
+                } /* Else, empty string */
+            } else {
+                const char *q = s;
+                while( isalnum(*q) || *q == '_' ) {
+                    q++;
+                }
+                if( q == s ) {
+                    *d++ = '$';
+                } else {
+                    char *tmp = g_strndup(s,q-s);
+                    s = q;
+                    char *value = getenv(tmp);
+                    g_free(tmp);
+                    if( value != NULL ) {
+                        int len = strlen(value);
+                        if( d + len > e )
+                            return g_strdup(input);
+                        strcpy(d, value);
+                        d += len;
+                    }
+                }
+            }
+        } else if( c == '\\' ) {
+            c = *s++;
+            if( c ) {
+                *d++ = c;
+            } else {
+                *d++ = '\\';
+            }
+        } else {
+            *d++ = c;
+        }
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     }
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-    memset(&we,0,sizeof(we));
-    int result = wordexp(input, &we, WRDE_NOCMD);
-    if( result != 0 || we.we_wordc == 0 ) {
-        /* On failure, return the original input unchanged */
-        return g_strdup(input);
-    } else {
-        /* On success, concatenate all 'words' together into a single 
-         * space-separated string
-         */
-        int length = we.we_wordc, i;
-        gchar *result, *p;
-        
-        for( i=0; i<we.we_wordc; i++ ) {
-            length += strlen(we.we_wordv[i]);
-        }
-        p = result = g_malloc(length);
-        for( i=0; i<we.we_wordc; i++ ) {
-            if( i != 0 )
-                *p++ = ' ';
-            strcpy( p, we.we_wordv[i] );
-            p += strlen(p);
-        }
-        wordfree(&we);
-        return result;
-    }        
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    *d = '\0';
+    return g_strdup(result);
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > }
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > gchar *get_absolute_path( const gchar *in_path )
 {
     char tmp[PATH_MAX];
</pre></div>
<hr /><a name="file4" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream/src</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>lxpaths.h</b></big> <small id="info" style="color: #888888;" >c4b725d901b1 -> a486ac64f34b</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/lxpaths.h
+++ lxdream/src/lxpaths.h
@@ -19,6 +19,8 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > #ifndef lxdream_paths_H
 #define lxdream_paths_H
 
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+#include <glib/gtypes.h>
+
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > /****************** System paths ****************/
 /**
  * Location of the shared lxdreamrc (e.g. /usr/local/etc/lxdreamrc)
</pre></div>
<hr /><a name="file5" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream/src/pvr2</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>glrender.c</b></big> <small id="info" style="color: #888888;" >c4b725d901b1 -> a486ac64f34b</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/pvr2/glrender.c
+++ lxdream/src/pvr2/glrender.c
@@ -46,10 +46,10 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >         GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_DST_ALPHA,
         GL_ONE_MINUS_DST_ALPHA };
 int pvr2_poly_texblend[4] = {
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-        GL_REPLACE, 
-        GL_MODULATE,  
-        GL_DECAL, 
-        GL_MODULATE 
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+        GL_REPLACE,
+        GL_MODULATE,
+        GL_DECAL,
+        GL_MODULATE
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > };
 
 static gboolean have_shaders = FALSE;
</pre></div>
<hr /><a name="file6" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span id="added" class="pathname" style="font-family:monospace; float:right; background-color:#ddffdd;" >lxdream/src/test</span><br />
<div id="added" class="fileheader" style="margin-bottom:.5em; background-color:#ddffdd;" ><big><b>testlxpaths.c</b></big> <small id="info" style="color: #888888;" >added at a486ac64f34b</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/test/testlxpaths.c
+++ lxdream/src/test/testlxpaths.c
@@ -0,0 +1,105 @@
</small></pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+/**
+ * $Id$
+ *
+ * Test cases for path helper functions
+ *
+ * Copyright (c) 2012 Nathan Keynes.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <glib/gmem.h>
+#include "lxpaths.h"
+
+char *lxdream_get_global_config_path_value() { }
+
+struct expanded_path_case_t {
+    const char *input;
+    const char *output;
+};
+
+char *env_vars[] = { "TEST1=quux", "TEST2=${BLAH}", "TEST3=", "2=3", "TEST_HOME=/home/foo", NULL };
+const char *unset_env_vars[] = { "PATH_TEST", "1", NULL };
+struct expanded_path_case_t expanded_path_cases[] = {
+    {NULL, NULL},
+    {"", ""},
+    {"a", "a"},
+    {"$", "$"},
+    {"blah$", "blah$"},
+    {"\\$", "$"},
+    {"foo\\${TEST}\\n\\\\r", "foo${TEST}n\\r"},
+    {"/home/user/.lxdreamrc", "/home/user/.lxdreamrc"},
+    {"${TEST_HOME}/.lxdreamrc", "/home/foo/.lxdreamrc"},
+    {"$TEST_HOME/bar", "/home/foo/bar"},
+    {"/home/$TEST1/blah", "/home/quux/blah"},
+    {"/tmp/${TEST2}/abcd", "/tmp/${BLAH}/abcd"},
+    {"$TEST1$TEST2$TEST3$1$2", "quux${BLAH}3"},
+    {NULL,NULL}
+};
+
+gboolean check_expanded_path( const char *input, const char *output )
+{
+    char * result = get_expanded_path(input);
+    if( output == NULL ) {
+        if( result != NULL ) {
+            printf( "Unexpected non-null result from get_expanded_path(NULL), got '%s'\n", result );
+            g_free(result);
+            return FALSE;
+        } else {
+            return TRUE;
+        }
+    } else if( result == NULL ) {
+        printf( "Unexpected NULL result from get_expanded_path('%s'), expected '%s'\n", input, output );
+        return FALSE;
+    } else if( strcmp(result, output) != 0 ) {
+        printf( "Unexpected result from get_expanded_path('%s'), expected '%s' but was '%s'\n", input, output, result );
+        g_free(result);
+        return FALSE;
+    } else {
+        g_free(result);
+        return TRUE;
+    }
+}
+
+
+gboolean test_get_expanded_path()
+{
+    int count, i;
+    int fails = 0;
+    
+    for( i=0; env_vars[i] != NULL; i++ ) {
+        putenv(env_vars[i]);
+    }
+    for( i=0; unset_env_vars[i] != NULL; i++ ) {
+        unsetenv(unset_env_vars[i]);
+    }
+
+    for( count=0; expanded_path_cases[count].input != NULL || count == 0; count++ ) {
+        gboolean success = check_expanded_path(expanded_path_cases[count].input, expanded_path_cases[count].output);
+        if( !success )
+            fails ++;
+    }
+    printf( "get_expanded_path: %d/%d (%s)\n", (count-fails), count, (fails == 0 ? "OK" : "ERROR"));
+    return fails == 0 ? TRUE : FALSE;
+
<a name="task1" />+    /* <span class="task" style="background-color:#ffff00;" >FIXME</span>: Should probably restore the env state, but doesn't matter at the moment */
+}
+
+int main()
+{
+    gboolean result = TRUE;
+    result =  test_get_expanded_path() && result;
+    
+    return result ? 0 : 1;
+}
</pre></div>
<center><small>Chaos Theory</small></center>
</div></body></html>