Skip to content

Commit

Permalink
WIP fix baseNameOf (needs test maybe)
Browse files Browse the repository at this point in the history
  • Loading branch information
roberth authored and tomberek committed Aug 23, 2024
1 parent a4ef062 commit ed16517
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/libexpr/primops.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1704,7 +1704,10 @@ static std::string_view legacyBaseNameOf(std::string_view path)
static void prim_baseNameOf(EvalState & state, const PosIdx pos, Value * * args, Value & v)
{
NixStringContext context;
v.mkString(legacyBaseNameOf(*state.coerceToString(pos, *args[0], context,
if (v.type() == nPath)
v.mkString(baseNameOf(v.path().path.abs()), context);
else
v.mkString(legacyBaseNameOf(*state.coerceToString(pos, *args[0], context,
"while evaluating the first argument passed to builtins.baseNameOf",
false, false)), context);
}
Expand Down

0 comments on commit ed16517

Please sign in to comment.