« Previous | Next » 

Revision d2234191

IDd223419141aaf303b5d7012990a19275e6a79544
Parent 3fffa0c6
Child 2656b017

Added by Santi Raffa about 7 years ago

PathJoin: improve error message when given one argument

PathJoin fails with an unclear message if only one argument is passed
to it. Calling PathJoin("/foo") causes this exception:

Error: path joining resulted in different prefix (/foo != /foo)

However, /foo and /foo obviously share prefixes: what this function
really checks is that the resulting path should be inside the first
argument and, in that sense, /foo is not a "real" prefix of /foo.

Given that PathJoin already asserts that it received any arguments
at all, this commit discards the assertion for an error to be raised
if 0 or 1 arguments are received. The semantics don't change, but
the error message is clearer.

Signed-off-by: Santi Raffa <>
Signed-off-by: Thomas Thrainer <>
Reviewed-by: Thomas Thrainer <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences