diff --git a/src/fix.cc b/src/fix.cc index eb77a49422..0797362fd0 100644 --- a/src/fix.cc +++ b/src/fix.cc @@ -208,6 +208,14 @@ static Expr evalExpr(Expr e) return ATmake("Include()", ((string) eHash).c_str()); } + /* BaseName primitive function. */ + if (ATmatch(e, "BaseName()", &e1)) { + e1 = evalExpr(e1); + if (!ATmatch(e1, "", &s1)) + throw badTerm("string expected", e1); + return ATmake("", baseNameOf(s1).c_str()); + } + /* Barf. */ throw badTerm("invalid expression", e); }