Index: Makefile ================================================================== --- Makefile +++ Makefile @@ -31,11 +31,11 @@ $(CC) $(CPPFLAGS) -DXVFS_MODE_CLIENT $(CFLAGS) -o example-client.o -c example.c example-client$(LIB_SUFFIX): example-client.o Makefile $(CC) $(CFLAGS) $(LDFLAGS) -shared -o example-client$(LIB_SUFFIX) example-client.o $(LIBS) $(TCL_STUB_LIB) -example-flexible.o: example.c xvfs-core.h Makefile +example-flexible.o: example.c xvfs-core.h xvfs-core.c Makefile $(CC) $(CPPFLAGS) -DXVFS_MODE_FLEXIBLE $(CFLAGS) -o example-flexible.o -c example.c example-flexible$(LIB_SUFFIX): example-flexible.o Makefile $(CC) $(CFLAGS) $(LDFLAGS) -shared -o example-flexible$(LIB_SUFFIX) example-flexible.o $(LIBS) $(TCL_STUB_LIB) Index: example/main.tcl ================================================================== --- example/main.tcl +++ example/main.tcl @@ -236,10 +236,14 @@ } -result "" tcltest::test xvfs-glob-executable "Xvfs Glob Executable Test " -body { glob -nocomplain -directory $rootDir -types x * } -result $rootDir/lib + +tcltest::test xvfs-glob-trailing-slash-1 "Xvfs Glob Trailing Slash Test" -body { + llength [glob -nocomplain -directory $rootDir/ *] +} -result 3 tcltest::test xvfs-access-basic-read "Xvfs acccess Read Basic Test" -body { file readable $testFile } -match boolean -result true Index: xvfs-core.c ================================================================== --- xvfs-core.c +++ xvfs-core.c @@ -131,11 +131,16 @@ while (pathLen >= 2 && memcmp(pathFinal, "./", 2) == 0) { pathFinal += 2; pathLen -= 2; } - XVFS_DEBUG_PRINTF("... relative path: \"%s\"", pathFinal); + while (pathLen >= 1 && pathFinal[0] == '/') { + pathFinal += 1; + pathLen -= 1; + } + + XVFS_DEBUG_PRINTF("... relative path: \"%s\" (pathLen = %i)", pathFinal, pathLen); XVFS_DEBUG_LEAVE; return(pathFinal); }