Are you assuming argv[0] is a full path ?  I'm not sure that's guaranteed.  It may be the command-name as typed on the command-line, which may have a relative path or no path at all (if it was found in $PATH).  If someone's already checked all our supported platforms do include a path, all's well, but nothing in the spec actually requires it.