> But there's nothing in that bit that implies (to me!) > "You can't subsequently call dirname(3) on the results of > a previous call to dirname(3)". You are calling dirname() on an argument that may be destroyed by that very call. You are calling dirname() on a possibly invalid argument.