summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--stdlib/Makefile3
-rw-r--r--stdlib/filename.mlp2
2 files changed, 3 insertions, 2 deletions
diff --git a/stdlib/Makefile b/stdlib/Makefile
index 5b7fd5c9e..c9a97320d 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -6,6 +6,7 @@ CAMLC=$(RUNTIME) $(COMPILER)
OPTCOMPILER=../cslopt
CAMLOPT=$(RUNTIME) $(OPTCOMPILER)
CAMLDEP=../boot/cslrun ../tools/csldep
+CPPFLAGS=-DUNIX
OBJS=pervasives.cmo list.cmo string.cmo char.cmo array.cmo sys.cmo \
hashtbl.cmo sort.cmo filename.cmo obj.cmo lexing.cmo parsing.cmo \
@@ -50,7 +51,7 @@ pervasives.cmx: pervasives.ml
filename.ml: filename.mlp ../config/Makefile
@rm -f filename.ml
- $(CPP) -DUNIX filename.mlp > filename.ml || \
+ $(CPP) $(CPPFLAGS) filename.mlp > filename.ml || \
{ rm -f filename.ml; exit 2; }
@chmod -w filename.ml
diff --git a/stdlib/filename.mlp b/stdlib/filename.mlp
index 7a364c1bd..646e7b32e 100644
--- a/stdlib/filename.mlp
+++ b/stdlib/filename.mlp
@@ -110,7 +110,7 @@ let rindexsep s =
let basename name =
try
- let p = rindexsep + 1 in
+ let p = rindexsep name + 1 in
String.sub name p (String.length name - p)
with Not_found ->
name